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 · 26 comments
Closed

Comments

@Hokutosei
Copy link

Hokutosei 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
Copy link

Same problem! Listening in...

@gumshoes
Copy link

.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
Copy link

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
Copy link

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
Copy link

masaab commented Nov 3, 2017

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

@Thenuwara
Copy link

Thenuwara commented Nov 16, 2017

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

InvalidOperationException: Cannot find compilation library location for package

@nzandy
Copy link

nzandy 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
Copy link
Contributor

kn100 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
Copy link
Contributor

kn100 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 as completed Aug 6, 2018
@sahil1436
Copy link

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

@sahil1436
Copy link

please help i am facing comparability issue.

@imaji
Copy link
Contributor

imaji 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
Copy link

Yunhan-Zheng 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!

@parad74
Copy link

parad74 commented May 31, 2019

The same problem like Yunhan-Zheng

@kn100
Copy link
Contributor

kn100 commented May 31, 2019

Hi @Yunhan-Zheng @parad74 - What error are you getting after you've added System.Configuration.configurationManager?

@Jmales
Copy link

Jmales commented Sep 12, 2019

So... this Nuget package works when I use it in .NET Core while in MacOS??

What happens when I use for example this function: ConfigurationManager.OpenExeConfiguration(...) ?

@mimogollon1
Copy link

mimogollon1 commented Nov 28, 2019

It worked for me to add the following tag in the csproj:

<Reference Include="System.Configuration">
  <HintPath>..\..\..\..\..\..\..\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Configuration.dll</HintPath>
</Reference>

before of </Project>

@jordi5300
Copy link

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.

Ty

@danielmeza
Copy link

I had the same issue, the reason was a package conflict between the same package in different project I solved by installing the same version in all my projects.

@PFLOA
Copy link

PFLOA commented Jul 7, 2020

<ItemGroup>
<Reference Include="System.Configuration.ConfigurationManager">
<HintPath> C:\Users\PauloFernando\.nuget\packages\system.configuration.configurationmanager\4.7.0\lib\netstandard2.0\System.Configuration.ConfigurationManager.dll `

Can you add a reference at your .csproj

@waqzah
Copy link

waqzah commented Jul 20, 2020

Same issue. Any solution?

Exception while executing function: EntityPlugin <--- Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

@waqzah
Copy link

waqzah commented Jul 21, 2020

I install Microsoft.Windows.Compatibility NuGet but same issue.

@synek317
Copy link

synek317 commented Mar 4, 2021

Today I've found another workaround, that works for me, but I have no idea why. At the beginning of my application (in my case - in the [OneTimeSetUp] of NUnit tests), I do

System.Reflection.Assembly.Load("System.Configuration.ConfigurationManager");

@itsmebhaskar
Copy link

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.

This fixed my problem too. Just adding nuget package to the running project.

@mohamedeshiba
Copy link

I had the same problem when I tried to connect to CosmosDb from a time triggered Azure Function.
Here what I did to solve the problem
1- downgraded the projecto to netcoreapp3.1
2- Used the Azure Function V3
3- used Microsoft.NET.Sdk.Functions version 3.1.1(any version 3)
4- Added <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput> in the property Group tag in the .csproj

It worked for me. Hope this helps

@masaab
Copy link

masaab commented Aug 25, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests