Type universe cannot resolve assembly: System.Configuration AND Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 11:56:22

问题


I am developing UWP App via VS2015 in Win10. My App was running perfect, but just today when I start running my App, even I didn't make changes of such ... and It shows 2 errors and is not running now.

1. Type universe cannot resolve assembly: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.      

2. Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll'  

What is these errors ... I didn't find the satisfactory solution


回答1:


I was able to resolve this by checking "Automatically check for missing packages during build in Visual Studio" (the "Allow NuGet to download missing packages" was already checked), then rebuilding. You can find these settings in Tools --> NuGet Package Manager --> Package Manager Settings.




回答2:


See this link, need to remove "Microsoft.VisualStudio.QualityTools.UnitTestFramework"




回答3:


I fixed a similar problem by deleting the C:\Users\%username%.nuget directory.




回答4:


UWP C# XAML App, MVS2017

I had a similar issue today, with the following error when building, after installing a new NUGET package (concretely NUGET package Microsoft.Toolkit.Uwp.UI.Controls):

"cannot resolve assembly or windows metadata file 'type universe cannot resolve assembly: netstandard, version=2.0.0.0, culture=neutral, …"

It turned out to be an incompatibility between NUGET package versions. I found out by fidgetting a bit in NUGET package manager with the package versions. A bit of trial and error, and I found out that by downgrading the version of the newly installed package, and upgrading the version of another package (in this case NewtonSoft.Json), I started building normally without errors or warnings...




回答5:


I ran across this in a somewhat dated build script. It was a build that used one top-level SLN composed of multiple SLN files from numerous projects and efforts. I used to be able to just do,

call nuget restore "%Top_Level_SLN_File%" -Recursive

and trust all the packages were getting restored. Now I have to run,

for /r %%I IN (*.sln) DO call nuget restore "%%~I" -Recursive

It might have to do with the fact that a private nuget feed is being leveraged for some of the packages, but that might be a red herring. I haven't deep-dived the issue to get minimal repro steps.



来源:https://stackoverflow.com/questions/36332437/type-universe-cannot-resolve-assembly-system-configuration-and-cannot-resolve-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!