1

Yesterday I did the update to VS (15.3), .NET Standard 2.0, .NET Core SDK 2.0 and so on. After that my current Xamarin Forms project broke. Most packages lost compatibility (although I did not change the standard1.4 version of the library). So I created a new standard1.4 library through VS (as stated here: https://xamarinhelp.com/visual-studio-2017-net-standard-xamarin/). I copied the code from the old Xamarin library to the new one and added all packages.

The problem now is that all xaml and xaml.cs are splitted and I get compile errors. I cant connect the files as I was used to (How can I connect xaml and xaml.cs files), because the csproj has completely changed through the evolution of netstandard. Whats even more astonishing is that even when I add a new xaml page to the project, the xaml and xaml.cs files are splitted. How can I fix this behavior?

Athari
  • 33,702
  • 16
  • 105
  • 146

1 Answers1

1

Found the solution, through my post on the Microsoft Developer Network (https://developercommunity.visualstudio.com/content/problem/96027/vs-153-netstandard-xaml-and-xamlcs-seperated-and-c.html)

Credit to Long Nguyen (see source):
Fixed it by following this article: https://oren.codes/2017/04/23/using-xamarin-forms-with-net-standard-vs-2017-edition/

In the .csproj file, you can see he declare the .xaml pages:

<ItemGroup>
  <!-- <a href="https://bugzilla.xamarin.com/show_bug.cgi?id=55591">https://bugzilla.xamarin.com/show_bug.cgi?id=55591</a> -->
  <None Remove="***.xaml" />
  <Compile Update="***.xaml.cs" DependentUpon="%(Filename)" />
  <EmbeddedResource Include="***.xaml" SubType="Designer" Generator="MSBuild:UpdateDesignTimeXaml" />
</ItemGroup>

After doing the changes to the csproj, it should pick up the xaml and xaml.cs files again.