Visual Studio – Error – “Could not load file or assembly ‘netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies.”

Background

Upon preparing Visual Studio to be able to develop mobile applications courtesy of Xamarin, ran into a blocking issue right away.

Set the Stage

Setting the stage for our error is easy  and it goes :-

  1. Launch Visual Studio
  2. Elected to design new Project
  3. Chose Project based on Mobile / Xamarin
  4. The system prepares the baseline project
  5. Attempted to build the project

Error

Error Image

CouldNotloadfileorassemblynetstandard.20181207.0340AM.PNG

Error Text


Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

Troubleshooting

Microsoft .Net Version

Review the version of Microsoft .Net that is installed.

Windows Explorer

Launched Windows Explorer and entered %windir%\Windows\Microsoft.NET\Framework64 as targeted folder.

Image

WindowsExplorer.20181207.0401AM

Explanation

We have a Version 4 version of Microsoft .Net installed; The baseline version # is v4.0.30319.

Please keep in mind that patches to his baseline might be installed, as well.

 

Registered Files

Registered File – netstandard.dll

Accessed %windir%\Windows\Microsoft.NET\Framework64  to determine if the referenced Assembly, netstandard.dll is present.

Confirmed it is not.

Remediation

Microsoft .Net Version

Goal

Installing .net framework 4.7.1 and above will help!

Artifacts

Availability

Please access https://dotnet.microsoft.com/download ( Link ) and see if there are newer versions of .Net than the one you have installed.

As of this morning, 2018-12-07, here is what is available.

Image

DotNetArtifacts.20181207.0826AM

Explanation

The latest .Net Framework, not the .Net Core, is 4.7.2.

 

Product :- v4.7.2

Image

DotNetArtifacts.4.7.2.20181207.0832AM.PNG

Explanation
  1. .Net Framework 4.7.2
    • Products
      • Build apps – Dev pack
      • Run apps – Runtime

We chose the Developer pack ( offline installer ).

Installer

Install

Images
License Terms

licenseTerms.20181207.0417AM.PNG

Setup Successful

setupSuccessfully.20181207.0426.PNG

 

Restarted Machine

Restarted Machine

Validation

Assemblies

Assembly – netstandard.dll

Windows Explorer

Accessed Windows Explorer and targeted C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Steps

Took the following steps :-

  1. Folder View
    • Columns
      • Added Date Created
    • Sort/Order
      • Ordering by Date Created
Image

WindowsExplorer.20181207.0843AM.PNG

Explanation
  1. netstandard.dll now included

 

Visual Studio

Project Build

Launched Visual Studio, loaded our mobile project, and it compiled successful with a couple of non-blocking warnings.

Image

newProject.errorList.noerrors.20181207.0516AM.PNG

Explanation

  1. As we do not have a Mac attached expected this warning.

 

Referenced Work

  1. xamarin
    • xamarin/Xamarin.Forms
      • Xamarin.Forms.Build.Tasks.GetTasksAbi build error #2667
        Link
    • forums.xamarin.com
  2. David Kean
    • Twitter ( @davkean )
      • Folks this is a bug in the Xamarin task – it’s making the assumption netstandard is in the GAC.
        Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s