Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msbuild v4 cannot reference newer versions of the build tools #135

Closed
poizan42 opened this issue Aug 2, 2015 · 1 comment
Closed

msbuild v4 cannot reference newer versions of the build tools #135

poizan42 opened this issue Aug 2, 2015 · 1 comment
Labels

Comments

@poizan42
Copy link

poizan42 commented Aug 2, 2015

Attempting to reference a newer build tools version gives a warning looking like this:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference "Microsoft.CodeAnalysis.Workspaces.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "14.0.0.0" than the version "4.0.0.0" in the current target framework. [C:\Users\kb\Documents\Visual Studio 2012\Projects\ExceptionSerializationCtorFixer\ExceptionSerializationCtorFixer\ExceptionSerializationCtorFixer.csproj]

It's the ResolveAssemblyReference task which generates this warning. The result is that the reference to the assembly which references the build tools assembly is simply ignored, resulting in the build failing later on. This issue has the consequence that Roslyn 1.0.0 cannot be used from VS2012. I have opened an issue at dotnet/roslyn#4166 with more details.

I'm not really sure how this issue can be resolved. Is it possible that an update could be made to the old build tools v4 in the .NET Framework and put into a KB update? Or distributed as part of the build tools v14 distribution?

@rainersigwald
Copy link
Member

Unfortunately, I don't think this is resolvable. We can allow referring to lower versions of the assembly from a higher-versioned one through binding redirects, but that wouldn't work in reverse. In your scenario we have to load Microsoft.Build v4 (to match MSBuild), and then we'd need to load Microsoft.Build v14 (required by Roslyn).

There might be some confusion here, because Microsoft.Build v14.0 is not a .NET Framework assembly, even though Microsoft.Build v4.0 is. I'm not sure if that's resolvable on our side, though (especially from the 4.0 tools, which we're not updating).

I think we have to say that building projects that consume MSBuild 14 assemblies must be built with MSBuild 14.

radical pushed a commit to radical/msbuild that referenced this issue Sep 16, 2019
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants