Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v5.0" were not found

Tags:

I use azure pipeline when I update my project to .Net 5 I get this error at build solution step .

Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v5.0" 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.

so how can I solve this problem ?

like image 820
mohammadmahdi Talachi Avatar asked Nov 30 '20 19:11

mohammadmahdi Talachi


People also ask

How to fix error MSB3644?

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.

How do you fix msb3971?

This error occurs when you're building for . NET 5 or later, but you're using an older version of the . NET SDK. This issue can usually be resolved by upgrading to a newer version of your build tools.


1 Answers

It's supported.

Since you are using .Net 5, instead of using Nuget restore, try to use Use .net core taskand Dotnet core task with restore command.

- task: UseDotNet@2
  displayName: 'Use .NET Core sdk 5.0.100'
  inputs:
    packageType: 'sdk'
    version: '5.0.100'
    includePreviewVersions: true

- task: DotNetCoreCLI@2
  displayName: 'dotnet restore'
  inputs:
    command: restore
    projects: '**/*.csproj'

It's strongly recommended to use dotnet restore and dotnet build tasks for projects that target .net core. See this statement from Nuget task:

Also take a look at this similar question here: Azure CI pipeline for Blazor .NET 5 doesn't work

For Classic editor, you could achieve this in same way, add use .NET Core and .NET Core task:

enter image description here

like image 95
PatrickLu-MSFT Avatar answered Sep 30 '22 16:09

PatrickLu-MSFT