4

I have an UWP app that i'm trying to build. It all works fine in debug mode, but when i switch to release and then try to build, it shows the error

error CS0012: The type 'Windows.UI.Xaml.FrameworkElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.

I've narrowd it down to the project property called "Compile with .NET Native tool chain" being the source of the problem. Atleast the project can build when i uncheck that property. I would however prefer to have the option enabled. I've added references to the Windows Desktop and Windows Mobile extensions.

Any idea of what i need to do to fix this?

MattWhilden
  • 1,686
  • 13
  • 18
Tommy
  • 51
  • 7
  • 2
    I work on the .NET Native Runtime and Compiler team. I don't know what's happening but would love to take a look. A reasonable set of steps for getting us a repro are outlined here: https://github.com/dotnet/core/blob/master/Documentation/ilcRepro.md – MattWhilden Jan 25 '16 at 19:10
  • I've followed the steps, outlined on the page you referenced. – Tommy Jan 26 '16 at 08:06
  • Thanks. I see your mail and we'll take a look in the morning. – MattWhilden Jan 26 '16 at 08:38

3 Answers3

1

After contacting Matt, he and his colleagues discovered that it was an error in .NET Native. So i just have to wait for the next update to .NET Native.

EDIT: After the latest update to Visual Studio 2015 (update 3), I can now successfully build the app in release mode with .NET native toolchain! Huzzah!

Tommy
  • 51
  • 7
0

I've had far too many problems with developing for Windows Universal. I've had problems similar to this. Re-install your Windows 10 SDK, This solved it for me!

Harvey
  • 1,320
  • 3
  • 13
  • 33
  • I already tried this, but thanks for the suggestion :) But as it turns out, the error is not on my machine or code, but in .NET Native. – Tommy Jan 28 '16 at 08:57
0

I answered a similar question. Do you use XmlSerializer to serialize a type which references winmd type? In your case the winmd type seems to be 'Windows.UI.Xaml.FrameworkElement'? If so, please have a look at my answer for that question. It seems that .Net Native tools have problem with generating XmlSerializer for types referencing winmd types.

Community
  • 1
  • 1
X-Mao
  • 509
  • 3
  • 10