Sdk: Can no longer compile net451 compatible builds on linux with 1.1 tooling

Created on 9 Mar 2017  路  4Comments  路  Source: dotnet/sdk

Steps to reproduce

  1. Create new directory
  2. Create global.json file with the following content:
{ 
  "projects": [ "src", "test" ], 
  "sdk": { 
    "version": "1.0.0-preview2-1-003177" 
  } 
} 
````
3. execute `dotnet new`
4. Edit project.json and add `net451` framework
5. Execute `dotnet restore` then `dotnet build`
6. Execute `dotnet run`
---> Observe everything works correctly

7. `rm global.json`
8. `dotnet migrate`
9. `dotnet build`
---> Observe the following error:

/usr/share/dotnet/sdk/1.0.1/Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5.1" 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. [/home/mshapiro/Code/test/test.csproj]
/usr/share/dotnet/sdk/1.0.1/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error : Assets file '/home/mshapiro/Code/test/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/home/mshapiro/Code/test/test.csproj]

## Environment data
`dotnet --info` output:

```.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.1

Most helpful comment

@dasMulli,

Thanks, setting export FrameworkPathOverride=/usr/lib/mono/4.5/ on Ubuntu and Debian solved the issue for me. cc @KallDrexx

All 4 comments

I'm having the same problem when targeting .NET 4.6.
@KallDrexx, did you find any workaround since then?

There is an open issue in the SDK repo about it: https://github.com/dotnet/sdk/issues/335

@dasMulli,

Thanks, setting export FrameworkPathOverride=/usr/lib/mono/4.5/ on Ubuntu and Debian solved the issue for me. cc @KallDrexx

We will track this in the SDK.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gkhanna79 picture gkhanna79  路  3Comments

darrensimio picture darrensimio  路  3Comments

dasMulli picture dasMulli  路  3Comments

clairernovotny picture clairernovotny  路  3Comments

dsplaisted picture dsplaisted  路  3Comments