Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly 'System.Configuration.ConfigurationManager #34

Closed
Hokutosei opened this issue Jun 9, 2017 · 13 comments

Comments

Projects
None yet
@Hokutosei
Copy link

commented Jun 9, 2017

Greetings,

I am having some issues using this lib for .netcore. here is the error. I am using a .netcore 2.0.0-preview1-005977 in macos.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

   at PusherClient.Pusher.Connect()

thank you

@Mrcampbell

This comment has been minimized.

Copy link

commented Oct 15, 2017

Same problem! Listening in...

@gumshoes

This comment has been minimized.

Copy link

commented Oct 19, 2017

.netcore does seem able to use
System.Configuration.ConfigurationManager
and throws the exception you posted when it encounters it.
Look for code such as:

ConfigurationManager.AppSettings.Get("SomeValue")
@seewaage

This comment has been minimized.

Copy link

commented Oct 24, 2017

I'm having this same issue with .netcore 2.0 at runtime. I'm getting an error
unhandled exception system.io.filenotfoundexception Could not load file or assembly 'System.Configuration.ConfigurationManager
I don't seem to be able to get rid of this issue even though it is compiling with no problems.
Does anyone have an idea of how to fix this?
Thanks!

@seewaage

This comment has been minimized.

Copy link

commented Oct 25, 2017

I fixed the problem I had. I was using the libraries that used System.Configuration.ConfigurationManager in another solution. When I used NuGet to add the System.Configuration.ConfigurationManager in the solution that called these other libraries it worked.

@masaab

This comment has been minimized.

Copy link

commented Nov 3, 2017

Installing Nuget package for System.Configuration.ConfigurationManager has solved the problem for us using .net core 2.0.

@Thenuwara

This comment has been minimized.

Copy link

commented Nov 16, 2017

My problem also solved Installing Nuget package for System.Configuration.ConfigurationManager

InvalidOperationException: Cannot find compilation library location for package

@nzandy

This comment has been minimized.

Copy link

commented Aug 6, 2018

The above solutions seem more like a hack? I am feeling reluctant to add an "unused" reference to my .NET framework 4.7.2 project (System.Configuration.ConfigurationManager). What happens in the future if a teammate sees this reference as unused and removes it? The build will still pass, but will result in runtime errors.

Does anyone have a proper fix?

Also in this situation - I am converting a class library to .NET standard for an enterprise solution - we may have 50+ projects that consume this - so potentially I need to add this reference in 50 places?

@kn100

This comment has been minimized.

Copy link
Contributor

commented Aug 6, 2018

Hi all!
This library does not officially support .NET core yet. I assume everybody experiencing this issue is trying to use it as such?

@kn100

This comment has been minimized.

Copy link
Contributor

commented Aug 6, 2018

Ah. The system.configuration.configurationmanager package is not unused. It is included with .NET versions which aren't core, which is why it's not defined in this package. It seems like some are getting this to work by adding the reference manually, but I can't endorse this since we haven't tested this internally. Core support is something we're interested in though and I'll let you all know when I know more!

I'll close the issue for now - but if anybody is having this issue not in .NET core, let me know!

@kn100 kn100 closed this Aug 6, 2018

@sahil1436

This comment has been minimized.

Copy link

commented Nov 12, 2018

any solution for consuming compatibility package which could help in consuming framework component in .net core

@sahil1436

This comment has been minimized.

Copy link

commented Nov 12, 2018

please help i am facing comparability issue.

@imaji

This comment has been minimized.

Copy link
Collaborator

commented Nov 12, 2018

Hi,

If you're using the .net core you need to install the system.configuration.configurationamanger nuget package.

Best regards,
John

@Yunhan-Zheng

This comment has been minimized.

Copy link

commented Jan 8, 2019

Hi,
I have a .NET FX46 referencing a NET standard lib which uses Serilog. The build on my local works but on build agent does not. The error is System.IO.FileloadException: could not load file or assembly System.Configuration.configurationManager, version=4.0.0.0, Culture=neutral, PublicKeyToken=.... from Serilog.Settings.AppSettings. I tried adding System.Configuration.configurationManager directly to my FX project, the build still fails. I also tried adding

<PropertyGroup>
  <_HasReferenceToSystemRuntime>true</_HasReferenceToSystemRuntime>
</PropertyGroup>

No luck. Would you please help?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.