ligershark / publish-ignore

Other
8 stars 4 forks source link

"CodeTaskFactory" could not be loaded from the assembly #12

Closed forbeshawkins closed 9 years ago

forbeshawkins commented 9 years ago

Hi

In VS2015 RTM, I'm receiving the following error when running a web publish:

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.

After googling around, I have altered ls.pubignore.wpp.targets in my project as follows:

added:

  <PropertyGroup Condition=" '$(ls-msbuildtasks-path)'=='' ">
    <ls-msbuildtasks-path>$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll</ls-msbuildtasks-path>
    <ls-msbuildtasks-path Condition=" !Exists('$(ls-msbuildtasks-path)')">$(MSBuildFrameworkToolsPath)\Microsoft.Build.Tasks.v4.0.dll</ls-msbuildtasks-path>
    <ls-msbuildtasks-path Condition=" !Exists('$(ls-msbuildtasks-path)')">$(windir)\Microsoft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll</ls-msbuildtasks-path>
  </PropertyGroup>

changed:

AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll"

to:

AssemblyFile="$(ls-msbuildtasks-path)">

Is this the bast way to deal with the problem? I haven't submitted a pull request because this feels like a hack and I don't understand why your code is not working.

Thanks

forbeshawkins commented 9 years ago

... should add, is a .Net 4.5 project

sayedihashimi commented 9 years ago

Yes that's good, can you send a PR so I can fix and release a new version?