none
Error message: The task factory "CodeTaskFactory" could not be loaded from the assembly

    Question

  • Hi,

    I just installed VS2015 professional. When I tried to compile a C# project, I got the following error message:

    Error                      The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll' or one of its dependencies. The system cannot find the file specified.

    I searched internet and couldn't find a working resolution.

    I'd like to know how to get Microsoft.Build.Tasks.v14.0.dll and how to install it.

    Thanks.

    Peiqing

    Friday, March 10, 2017 3:06 PM

All replies

  • Hi Peiqing,

    As you said that you use the VS2015, whether this project was created in previous old VS version.

    How did you build your app? Do you use the TFS or MSbuild in command line?

    >>The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll' or one of its dependencies. The system cannot find the file specified.

    Please check that whether it is related to the targets file AssemblyFile="$(ls-msbuildtasks-path)">
    Reference:

    https://github.com/ligershark/publish-ignore/issues/12

    http://stackoverflow.com/questions/20661943/build-on-tfs-2013-failed-but-okay-locally

    In addition, the MSbuild path has been changed from the VS2013.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 13, 2017 5:58 AM
    Moderator