Skip to content

Building on Mac/Linux with net45/net46 targets #335

@dtchepak

Description

@dtchepak

dotnet build on Mac:

error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. 

I have dotnet CLI 2.0.0 and Mono 5.4.1.4 installed:

~/dev/git/nsubstitute  [master]✗ % dotnet --version
2.0.0
~/dev/git/nsubstitute  [master]✗ % mono --version
Mono JIT compiler version 5.4.1.4 (2017-06/c6605763a36 Fri Oct 13 15:34:43 EDT 2017)
...

According to this comment referencing Microsoft.TargetingPack.NETFramework.v4.6.1 might help?

<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6.1" Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" /> 

Using dotnet test -f netcoreapp1.1 succeed (with a warning):

~/dev/git/nsubstitute  [master]✗ % dotnet test -f netcoreapp1.1
Build started, please wait...
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(165,5): error : Assets file '/Users/dtchepak/dev/git/nsubstitute/src/NSubstitute/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v1.1'. Ensure that restore has run and that you have included 'netcoreapp1.1' in the TargetFrameworks for your project. [/Users/dtchepak/dev/git/nsubstitute/src/NSubstitute/NSubstitute.csproj]
Build started, please wait...
Build completed.
...
Total tests: 465. Passed: 443. Failed: 0. Skipped: 8.
Test Run Successful.
Test execution time: 2.8702 Seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues relating to builds: compile, running tests, CIgood first issueFor smaller tasks that do not require in-depth knowledge of the code basehelp wantedCore team needs help with this! If you've got some time, please volunteer to take a look.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions