Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms Project with netstandard: can't build UWP

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?

like image 818
Ced Avatar asked May 28 '18 10:05

Ced


1 Answers

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

in your case to myapp.Basic

like image 50
user11342018 Avatar answered Sep 19 '22 00:09

user11342018