Reputation: 114126
I'm trying to build FluentFTP, which has releases for .NET 2.0, 3.5, 4.0 and .NET Standard. All of the releases build fine within the VS 2017 IDE on Windows 7. However when I try to build using dotnet.exe
, it crashes with this error:
"Reference assemblies for framework NETFramework,Version v2.0" were not found...
My build script looks like this:
dotnet --info
dotnet restore -v Minimal
dotnet build -c Release
pause
How do I build this successfully from the console?
Upvotes: 2
Views: 1105
Reputation: 9946
Per the docs the dotnet build
command-line approach is only meant to support .NET Core builds, not .NET Framework builds.
.NET Framework 2.0 isn't supported by any current build system and it also isn't supported by Visual Studio 2017, so I'm surprised it worked correctly. I believe VS2010 was the last version to officially support .NET 2.0 development. .NET Framework builds rely on msbuild (so does dotnet build
but with different switches and files).
Visual Studio 2017 Support for .NET Development states that VS2017 supports:
- .NET Framework versions 4.7, 4.6.2, 4.6.1, 4.6, 4.5.2, and 3.5
- .NET Core 2.0, 1.1, and 1.0.
- .NET Native
- Mono
Upvotes: 1
Reputation: 810
It would appear you are missing the .NET 2.0 SDK, here are the links to install it:
x86
https://www.microsoft.com/en-us/download/details.aspx?id=19988
x64
https://www.microsoft.com/en-us/download/details.aspx?id=15354
Upvotes: 1