Reputation: 2516
I am trying to compile a small test build (written in C#) in Visual Studio. However, I get two errors when trying so and can't find the issue. No line's are given:
Error 1: small_project.csproj
Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll'
Error 2:
Type universe cannot resolve assembly: System.Configuration, Version 2.0.0.0, Culture=neutral, PublicKeyToken.. etc..
I am new at developing with C# and XAML. Does someone know what could cause these errors?
Upvotes: 14
Views: 14912
Reputation: 81
In my case the problem was that my UWP project referenced a project that referenced System.Web.Application.dll. I did:
I learnt it's better to use nuget packages instead of adding references manually.
Upvotes: 0
Reputation: 6978
I had this issue when my project's nuget packages weren't available when trying a remote build on Jenkins.
I just added a build-step to locate NuGet and then call restore
on the project/solution to resolve this for automation purposes.
This is just a segment of a script that I'm copying, so update to your needs:
where nuget > nul 2>&1 nul
IF "%errorlevel%"=="0" where nuget > .\where_nuget.txt && Set where_nuget=where_nuget.txt
IF NOT "%where_nuget%"=="" FOR /F "tokens=*" %%I IN ('type where_nuget.txt') DO call "%%I" restore "%Build_Target%"
Upvotes: 0
Reputation: 2409
I know that this question is old and all, but I am faced with the same error. I've done numerous xaml apps using a variety of test frameworks. I think that you might have made a Universal Windows App using the Unit Test template. Something in the MStest framework that was added was giving me the same exception that you reported here. After lots of looking around I watched a channel 9 video that mentioned them using xUnit for their UWP testing. I went to this site xUnit on github and did what they mentioned which was:
I'll have to keep in mind that testing UWP is going to be different than normal apps and so to change my expectations. Hopefully this helps others as well as the OP.
Upvotes: 0