Search code examples
visual-studio-2017nuget

Nuget installing debian package into .NET framework 4.6.1 project; Why?


I have a project and whenever I perform a nuget update it fails with the following:

15:47:27
    Successfully installed 'Microsoft.NETCore.Targets 3.1.0' to MyProject.csproj
15:47:27
    WARNING: Install failed. Rolling back...
15:47:27
    WARNING: Package 'runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3' does not exist in project 'MyProject.csproj'
15:47:27
    Removed package 'Microsoft.NETCore.Targets 3.1.0' from 'packages.config'

Is anyone able to provide clarification on why it is trying to install a debian package? I looked at the dependencies for https://www.nuget.org/packages/Microsoft.NETCore.Targets/

It appears there are none(?)

Thanks in advance Mark


Solution

  • Nuget installing debian package into .NET framework 4.6.1 project; Why?

    Actually, that package does not have a dependency called runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3 and I am also wonder why your net framework project needs that dependency.

    Also, I found that Net Framework project cannot install that package since it is not compatible with Net Framework. Please check whether your project has any dependent projects.

    It is quite strange and I think that something has broken in Nuget,VS or your project itself.

    Suggestion

    1) disable any third party extensions under Tools-->Extensions and Updates in case some extensions cause this abnormal behavior.

    2) click clean all nuget caches under Tools-->Options-->Nuget Package Manager-->General

    3) Close VS, delete Nuget.config file under C:\Users\xxx(current user name)\AppData\Roaming\Nuget,also check whether you have a new nuget.config file on your project parent directory or higher.

    4) delete .vs hidden folder under solution folder, bin and obj folder and then run update-package -reinstall on Package Manager Console(Tools-->Nuget Package Manger to reinstall every nuget packages.

    5) run Developer Command Prompt for VS2017 as Administrator and then type:

    regsvr32 "C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VsLangproj.olb"
    

    Make sure that the file exists under the path. See this document.

    6) repair VS in VS Installer or update it to the latest version.

    I suggest you could try every step above and give us any feedback about it.