7

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?

4
  • Can you set it to copy local and then do an assembly bind to that version and see if it works? I have no idea why it's not working btw but I'd try this if I were you and see how it goes. Commented Nov 3, 2017 at 15:06
  • Version 0 is not a very happy number, hard to imagine what kind of sledgehammer was involved. In general, the .NETCore runtime cannot load a .NET Framework assembly, you'd have to rebuild the assembly by targeting .NETStandard. That is not necessarily simple, they did release a core replacement for System.Configuration recently. As always, the best advice is to wait until they are done. The proverbial version 3, perhaps. Commented Nov 3, 2017 at 15:40
  • What universe am I living in? Are these machines supposed to be putting everyone out of a job in the next couple of decades? Commented Nov 3, 2017 at 15:59
  • Related post - How do I reference a .NET Framework project in a .NET Core project? Commented Sep 28, 2021 at 9:40

2 Answers 2

4

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?

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.