Skip to content

Cannot find reference assemblies for .NET 3.5 or lower using core msbuild #1333

@nguerrera

Description

@nguerrera

dotnet/sdk supports targeting .NET 3.5 just fine if you use desktop msbuild, but it fails to find the reference assemblies using core msbuild. Both desktop and core work fine for NET4.0+.

Steps to reproduce

Create a new project with dotnet new
Change the TargetFramework to net35 or lower
Add <RuntimeIdentifier>win10-x64</RuntimeIdentifier> to the .csproj
dotnet restore
dotnet build

I've been seeing this issue since the move to msbuild. Targeting .NET 3.5 and lower works in the Preview 2 release SDK. All the relevant targeting packs are installed.

Expected behavior

A successful build

Actual behavior

Fails with the error:
... error MSB3644: The reference assemblies for framework ".NETFramework,Version=v3.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. ...

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview3-004056)

Product Information:
Version: 1.0.0-preview3-004056
Commit SHA-1 hash: ccc4968

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64

Moved from https://github.com/dotnet/cli/issues/4626 for @Thealexbarney.

Moved from dotnet/sdk#369 for @piotrpMSFT

@rainersigwald

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions