6

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?

Community
  • 1
  • 1
Ced
  • 1,301
  • 11
  • 30

2 Answers2

5

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

in your case to myapp.Basic

user11342018
  • 51
  • 1
  • 2
4

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
nzrytmn
  • 6,193
  • 1
  • 41
  • 38