Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS16.2: Xaml Compiler Error when including Microsoft.Xaml.Behaviors.Uwp.Managed #182

Closed
jeromelaban opened this issue Sep 6, 2019 · 3 comments

Comments

@jeromelaban
Copy link
Contributor

When building the project below with VS 16.2 and higher, with MSBuild extras 2.0.0-preview.7 and higher, the following error appears:

XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 
'Type universe cannot resolve assembly: Windows.Foundation.UniversalApiContract,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime.'

When using MSBuild extras 1.6.68, the project builds successfully.

The project:

<Project Sdk="MSBuild.Sdk.Extras/2.0.0-preview.7">
  
  <PropertyGroup>
    <TargetFrameworks>uap10.0.16299</TargetFrameworks>
  </PropertyGroup>
  
  <ItemGroup>
    <Page Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
  </ItemGroup>
</Project>

Installing the SDK 10586 (where the 2.0.0.0 was introduced) does not fix the issue.
TestXamlCrash.zip

@jeromelaban
Copy link
Contributor Author

This issue impacts the windows community toolkit. I'm trying to chase down where the origin of the issue, without much luck yet.

@jeromelaban
Copy link
Contributor Author

Ok, I was lucky this time. It seems that:

https://github.com/onovotny/MSBuildSdkExtras/blob/f1476ba441d9eacf4152ea04e5cc2e05b97ea6f8/Source/MSBuild.Sdk.Extras/Build/Platforms/Windows.targets#L63

is to blame. Setting it to true fixes the issue.

@onovotny Would you know what is the use of the property ?

jeromelaban added a commit to unoplatform/Uno.WindowsCommunityToolkit that referenced this issue Sep 6, 2019
clairernovotny pushed a commit that referenced this issue Sep 7, 2019
@jeromelaban
Copy link
Contributor Author

Thanks Oren!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant