hallatore / Netling

Netling is a load tester client for easy web testing.
MIT License
1.34k stars 210 forks source link

Reference to .NET 5.0 fails #41

Open tahalukmanji opened 3 years ago

tahalukmanji commented 3 years ago

I downloaded the latest .NET 5 SDK preview 7. Yet, I cannot build netling project as I get error like:

Severity Code Description Project File Line Suppression State Error MSB3644 The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks Netling.Core C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1177
Error Project '..\Netling.Core\Netling.Core.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.Core.HttpClientWorker C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core.SocketWorker\Netling.Core.SocketWorker.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.Benchmarks C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core\Netling.Core.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.Benchmarks C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core.HttpClientWorker\Netling.Core.HttpClientWorker.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.Client C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core.SocketWorker\Netling.Core.SocketWorker.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.Client C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core\Netling.Core.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.Client C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core.HttpClientWorker\Netling.Core.HttpClientWorker.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.ConsoleClient C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core.SocketWorker\Netling.Core.SocketWorker.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.ConsoleClient C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error Project '..\Netling.Core\Netling.Core.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v5.0'. Netling.ConsoleClient C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1655
Error MSB3644 The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks Netling.Tests C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1177
Error MSB3644 The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks Netling.Benchmarks C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1177

Please advise what to do next.

simon-flanagan commented 3 years ago

I just have fixed something similar on my system- it might be a bit late for the original question but might help someone:

In my case it was that I had assumed that the latest version of the .net 5 SDK and the latest version of Visual Studio would be compatible. This is not the case - I think particularly because the SDK is still in preview you need a preview version of VS to be able to run it. At the time of writing the latest main-line version of VS is 16.7.3 and the version of the .net 5 SDK that is compatible is .NET 5.0 SDK (v5.0.100-preview.7).

In my investigations it also seems like installing the correct processor version (x86 vs x64) is also a common cause of this issue.