0

I have an app that runs perfectly in Debug mode but causes this error in Release mode. System.Reflection.MissingMetadataException Additional information: 'Windows.ApplicationModel.Resources.ResourceLoader'

I have read that because the Release version compiles to .NET Native, I need to add a reflection directive to the default.rd.xml file.

Any help would be appreciated.

OzFrog
  • 47
  • 7
  • Go to project properties -> Build and enable "Compile with .NET Native tool chain" for "Debug" configuration. It may help further in locating the error. – Gaurav Jan 31 '16 at 06:48
  • Gaurav I tried this and also set the debugger type to Native Only but all I received was 'The process started but the activation request failed with error 'The app didn't start'. – OzFrog Jan 31 '16 at 07:48
  • This is an entirely normal mishap when you test your app in the Release build. Something you are supposed to do to verify that .NET Native can properly build your app. Right now it can't, it cannot know what classes might be loaded through Reflection so cannot properly detect that they need to be included in the final image. You have to help and list those classes in the Default.rd.xml file. Just google the exception name, all of the top hits describe the procedure. – Hans Passant Jan 31 '16 at 13:59
  • @Hans Passant I understand the requirements now and realise that my assumption above as to the source was incorrect. I have traced the error to 'Windows.ApplicationModel.Resources.ResourceLoader' and specifically the GetString method. However I am not sure how to solve it. – OzFrog Feb 04 '16 at 05:53
  • This works: Dim rl = New Windows.ApplicationModel.Resources.ResourceLoader This does not work: Public Shared Property rl = New Windows.ApplicationModel.Resources.ResourceLoader – OzFrog Feb 04 '16 at 09:34
  • I now realise that I should not have used type inference in the public property declaration. Public Shared Property rl As New Windows.ApplicationModel.Resources.ResourceLoader works fine and it does not need a special directive. – OzFrog Feb 05 '16 at 03:14

0 Answers0