question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package is not compatible with net452, but supports net45

See original GitHub issue

Steps to reproduce

Added AutoMapper 5.0.2 package to my project. The restore fails with the error AutoMapper 5.0.2 is not compatible with net452.

Expected behavior

It should restore. I understand net45 === net452.

Actual behavior

Errors in C:\Source\MyWebApi\project.json
    Package AutoMapper 5.0.2 is not compatible with net452 (.NETFramework,Version=v4.5.2). Package AutoMapper 5.0.2 supports:
      - net45 (.NETFramework,Version=v4.5)
      - netstandard1.1 (.NETStandard,Version=v1.1)
      - netstandard1.3 (.NETStandard,Version=v1.3)
    One or more packages are incompatible with .NETFramework,Version=v4.5.2.

NuGet Config files used:
    C:\Users\Dennis\AppData\Roaming\NuGet\NuGet.Config
    C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config

Feeds used:
    https://api.nuget.org/v3/index.json
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
 Version:            1.0.0-preview2-003121
 Commit SHA-1 hash:  1e9d529bc5

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

Steps taken

Frustratingly, it restores and builds on the hosted VSTS agent and on another laptop. It is something wrong with local installation, however can’t determine the cause.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dennisrochecommented, Aug 5, 2016

FIXED!

nuget.exe locals -clear all

Thanks to the help of Yishai Galatzer, https://twitter.com/yigalatz/status/761260527599353860

0reactions
JoseFMPcommented, Jul 10, 2017

Experiencing similar issue over here. Unity.Practices should be compatible with .net 4.6.2 right? Suddenly it is not. Weird.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nuget - Could not install package '--'. You are trying to ...
Your package targets NETFramework,Version=v4.5.2. That means the assembly folder is lib\net452. You are trying to install the package to a ...
Read more >
Target Frameworks Reference for NuGet
Profile # Frameworks Full name Profile2.NETFramework 4.0 portable‑net40+win8+sl4+wp7 Profile3.NETFramework 4.0 portable‑net40+sl4 Profile4.NETFramework 4.5 portable‑net45+sl4+win8+wp7
Read more >
Target frameworks in SDK-style projects - .NET
The following table shows the target frameworks supported by the .NET SDK and the NuGet client. Equivalents are shown within brackets.
Read more >
Fixing issue related to Package is not compatible with ...
Fixing issue related to Package is not compatible with netcoreapp2.1, supports netstandard2.0, when using Azure DevOps (VSTS).
Read more >
Package NSG_DPI 1.0.32 is not compatible with net6.0- ...
I received a message on my project that it was using windows- legacy compatibility and that I needed to convert it to windows....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found