Ian Warburton
Ian Warburton

Reputation: 15666

How to use .net framework from .net core?

I have a .net core xUnit project that references a .net framework project that references Microsoft's Azure Notification Hub API.

It builds, but when try and create a hub, I get the error...

Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

Which seems like an odd error to get given that System.Configuration is referenced.

How do I make the Azure referencing project act like a framework 4.7 project?

Upvotes: 7

Views: 5143

Answers (2)

Lex Li
Lex Li

Reputation: 63123

Microsoft just shipped a new version that's compatible to .NET Standard 2.0,

https://azure.microsoft.com/en-us/updates/azure-notifications-hubs-net-sdk-now-compatible-with-net-standard-2-0/

Please upgrade your SDK to use that. Of course, you need to make other changes according to their documentation.

Upvotes: 2

Alex Sanséau
Alex Sanséau

Reputation: 8750

If you are targeting .NET Core, make sure you've referenced NuGet package System.Configuration.ConfigurationManager.

See related question: Is ConfigurationManager.AppSettings available in .NET Core 2.0?

Upvotes: 4

Related Questions