Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The Microsoft.VSSDK.BuildTools NuGet package contains assemblies and MSBuild project files and targets to create Visual Studio .vsix files:
The `build/Microsoft.VSSDK.BuildTools.targets` file contains this XML fragment:
> <UsingTask TaskName="SetVsSDKEnvironmentVariables" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
This fragment fails when running on Mono 5.2 (2017-04), *not* mono 5.0 (2017-02) or mono 4.8:
> error MSB4174: The task factory "CodeTaskFactory" could not be found in the assembly
Simplified test case, courtesy Alexander Köplinger:
<UsingTask TaskName="foo" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<foo Text="Hello, World!" />
after discussing with Ankit, we've agreed this bug is best fixed in 15.4 given that it's not trivial and may require extensive testing.
I can CONFIRM this issue using Jon P's basic repro in https://bugzilla.xamarin.com/show_bug.cgi?id=56633#c0
I have also identified that this happens in Mono 5.0.1, so it's likely this isn't an immediate regression.
I believe this is similar to the following:
In which a similar workaround could be used:
<?xml version="1.0" encoding="utf-8"?>
<UsingTask TaskName="foo" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\$(TasksAssemblyName).dll">
<foo Text="$(MSBuildToolsPath)" />
Either way, it looks like things were renamed and moved. Mono doesn't seem to reflect that compared to MSBuild on windows.
Fixed for 15.4: