-
Notifications
You must be signed in to change notification settings - Fork 427
Can't build 4.6.1 project that references netstandard on CI server with VS Build Tools 15.3.1 #458
Comments
Update: adding the |
One more update for anyone who stumbles here with the same problem: I found the issue at dotnet/msbuild#1697 and then went back to check the VS Installer and found the ".NET Core build tools" were not selected: After adding that checkbox and removing the I lost almost a whole day to this, which is mostly my fault for not thinking to check the installed build tools components. However, the upgrade experience could have been clearer. When you update from an older version of the VS Build Tools to the newest one, the option to include .NET Core components is deselected by default and you're never presented with a window or dialog indicating that you have to opt-in. If it weren't for the other GH issue I linked, I'm not sure I ever would have checked the VS Installer again. Perhaps .NET Core build tools should be opt-out instead of opt-in, or at least a dialog could be shown letting upgraders know that if they want .NET Core/netstandard support they need to check the box. |
@daveaglick are you saying that you did have .NET Core components checked (and installed) but then upgrade unchecked it? That doesn't seem right. |
@danmosemsft Pretty sure it was never checked. IMO the problem is that the upgrade process for VS Build Tools never surfaces it as an option. Unless you know you know beforehand to modify the installation and check the box, you may assume (as I did) that .NET Core support ships by default. |
@danmosemsft Is there a plan for making all .net workloads depend on the necessary tooling to support ns2.0? It's probably ok now but if the plan going forward is for package authors to publish ns2.0 nuget packages and the support is missing, that would be unfortunate. ("why do I need to install .NET Core to use a NuGet package in my decade old WinForms application?") |
@terrajobst can you speak to the comment above about it not being intuitive when .NET Core workload is needed and missing? |
To summarize:
|
Installing the .NET Core Build Tools worked for me as well. I just burned ~4 hours on this trying to build a 4.6.1 project with a .NET Standard 2 library. Built fine locally w/ VS 2017 15.4.1 but died on my on-prem TeamCity server. I had the dotnet SDK installed and the Web Development Build Tools installed, but I did not have the .NET Core build tools installed. Would've thought the SDK would include everything, including the .NET Core build tools...? We have other apps that are .NET Core + .NET Standard, and having just the SDK installed, because we were using the dotnet cli to restore/build/publish. This was just our first app that combined .NET Framework + .NET Standard. Came pretty close to just installing full VS until I found this, so thanks for this. The error I got is below to boost the Google foo of this issue: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.Common.targets(73, 5): Project 'C:\pathgoeshere.csproj' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6.1'. |
I was facing |
Fix for us was adding this small reference line above the other references in the csproj file. |
I fixed this by referencing (as I couldn't upgrade our build server) Changing my references from lib\netstandard2.0 to lib\portable-net45+win8+wp8+wpa81
Rather than
|
@michal-ciechan that was my issue too! Thanks a lot! |
I fixed the problem by modifying my visual studio professional 2017 by checking:
Also, make sure that you have NuGet package manager checked |
@terrajobst Thanks so much! Your suggestion saved the day for me when trying to build .NET Standard 2.0 projects. I used this chocolatey package to install the .NET Core build tools as part of my CI/CD pipeline: https://chocolatey.org/packages/visualstudio2017-workload-netcorebuildtools. |
I'm having an issue on my in-house Bamboo CI server. I'm attempting to build a .NET Framework 4.6.1 project that uses some netstandard libraries. Everything works fine on my dev system, but on my CI server with build tools I get several errors that look similar to:
The build server has the latest .NET Core SDK and the latest build tools:
However, MSBuild can't find
netstandard.dll
no matter what I try:I did notice this:
And verified the target exists:
Also worth noting this behavior happens whether I run the build from CI or directly from the command line using MSBuild so it's not directly related to Bamboo. At this point I'm blocked and I've run out of things to try. May attempt to use that prerelease
NETStandard.Library.NETFramework
package but would like to avoid that if I can since it means someone will have to remember to pull it back out later.(copied from #454 (comment))
The text was updated successfully, but these errors were encountered: