6
votes

currently I'm working on a Xamarin app, which uses the .Net-Standard code sharing strategy. While I ca build and run the succesfully on android, i have some problems with the UWP project.

When I try to build the project I'm receiving this error messages:

Could not copy the file "obj\x86\Debug\myapp.UWP.xr.xml" because it was not found.

Could not copy the file "obj\x86\Debug\MainPage.xbf" because it was not found.

Could not copy the file "obj\x86\Debug\App.xbf" because it was not found.

Cannot resolve Assembly or Windows Metadata file 'Type universe cannot resolve assembly: myapp.Basic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.'

While I was looking for these error messages I found this thread on stackoverflow:

Missing xaml.xr of a class library file in UWP

The thread suggestes to enable the "Generate library layout" in projects that contains XAML-code, which looked very promising, because the myapp.Basic Project contains some XAML-code. Unluckily this option is totaly missing in .Net-standard projects.

Can anybody help me solve this problem?

2
Have you tried clean your solution and redeploy it before building? - Nico Zhu - MSFT
Yes of course, this was was first thing I have tried :) - Ced
And this option only applies to ClassLibrary. - Nico Zhu - MSFT
You could try delete bin obj folder in UWP project manually. - Nico Zhu - MSFT
make sure the MinTarget Build for UWP is set to at least Build 16299 - magicandre1981

2 Answers

4
votes

In your UWP Project manually add reference to any additional .Net Standard Class library project

in your case to myapp.Basic

4
votes

Bu sure that you add all .Net Standard Class libraries references in your solution to UWP project. For Android and IOS projects adding the main shared code project's reference is enough; but for UWP if you have an extra class library project that your shared code project use you have to add this project too as a reference to UWP project.