Closed adiaz-msft closed 3 years ago
I was able to reproduce what you were seeing immediately.
Based on the error(s) that were occurring I wanted to confirm that a plain project would compile. I removed the Optimizely SDK and as expected it compiled successfully. I then re-added the SDK via NuGet and was shocked that the project compiled and ran as expected.
I've filled a bug report with Microsoft with Visual Studio: https://developercommunity.visualstudio.com/t/error-when-trying-to-build-uwp-app-after-adding-sd/1516205
Currently the best way to work around this is to add the Optimizely SDK after you've correctly built the existing UWP project.
This is issue with .nuspec of Optimizely.SDK. It should declare a dependency on System.Configuration.ConfigurationManager
I'll double check on this. Thanks for the additional info @srdjanjovcic
@srdjanjovcic can you provide some additional information on why this build would work on additional builds? It seems interesting that the errors are intermittent.
I do not know why it was working after a specific build, but bug as described does not repro if Optimizely.SDK contains a dependency on System.Configuration.ConfigurationManager.
Create a new "Blank App (Universal Windows)" C# UWP app using VS-2019 using default parameters. add Optimizely.SDK 3.9.1, NuGet package from https://www.nuget.org/packages/Optimizely.SDK
Add some simple calls to initialize SDK. Try to build x86 or x64 give same errors: Severity Code Description Project File Line Suppression State Error Could not copy the file "obj\x86\Debug\App.xbf" because it was not found. OptimizelyUWPTest
Error Could not copy the file "obj\x86\Debug\MainPage.xbf" because it was not found. OptimizelyUWPTest
Error Could not copy the file "obj\x86\Debug\OptimizelyUWPTest.xr.xml" because it was not found. OptimizelyUWPTest
Error Cannot resolve Assembly or Windows Metadata file 'Type universe cannot resolve assembly: System.Configuration.ConfigurationManager, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.' OptimizelyUWPTest C:\Users\angel\ms-src\Scratch\Optimizely\OptimizelyUWPTest\OptimizelyUWPTest\OptimizelyUWPTest.csproj
Note that a C# .NET Core console app does work.
See attached test project. OptimizelyUWPTest.zip