UWP with Castle.Core: Compile with .NET Native tool chain error












0















In our UWP App when building the app with .NET Native tool chain activated, we get the following error:



Exception thrown: 'System.Exception' in Castle.Core.dll
An exception of type 'System.Exception' occurred in Castle.Core.dll but was not handled in user code
Method 'TypeBuilder.AddInterfaceImplementation(Type)' was not included in compilation, but was referenced in ClassEmitter..ctor(ModuleScope, string, Type, IEnumerable<Type>, TypeAttributes, bool). There may have been a missing assembly.


Our Default.rd.xml looks like this:



<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
</Application>
</Directives>


I cannot figure out, what I have to add to the Default.rd.xml to make my app works also with the .NET Native tool chain activated.



We're using Castle.Core for method interception within our Autofac IOC in our UWP App.



Thanks for your help,
Peter










share|improve this question


















  • 1





    While this is legitimate question you will hardly get answer for so specialized solutions, try to ask the provider directly.

    – Ivan Ičin
    Nov 21 '18 at 13:45
















0















In our UWP App when building the app with .NET Native tool chain activated, we get the following error:



Exception thrown: 'System.Exception' in Castle.Core.dll
An exception of type 'System.Exception' occurred in Castle.Core.dll but was not handled in user code
Method 'TypeBuilder.AddInterfaceImplementation(Type)' was not included in compilation, but was referenced in ClassEmitter..ctor(ModuleScope, string, Type, IEnumerable<Type>, TypeAttributes, bool). There may have been a missing assembly.


Our Default.rd.xml looks like this:



<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
</Application>
</Directives>


I cannot figure out, what I have to add to the Default.rd.xml to make my app works also with the .NET Native tool chain activated.



We're using Castle.Core for method interception within our Autofac IOC in our UWP App.



Thanks for your help,
Peter










share|improve this question


















  • 1





    While this is legitimate question you will hardly get answer for so specialized solutions, try to ask the provider directly.

    – Ivan Ičin
    Nov 21 '18 at 13:45














0












0








0








In our UWP App when building the app with .NET Native tool chain activated, we get the following error:



Exception thrown: 'System.Exception' in Castle.Core.dll
An exception of type 'System.Exception' occurred in Castle.Core.dll but was not handled in user code
Method 'TypeBuilder.AddInterfaceImplementation(Type)' was not included in compilation, but was referenced in ClassEmitter..ctor(ModuleScope, string, Type, IEnumerable<Type>, TypeAttributes, bool). There may have been a missing assembly.


Our Default.rd.xml looks like this:



<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
</Application>
</Directives>


I cannot figure out, what I have to add to the Default.rd.xml to make my app works also with the .NET Native tool chain activated.



We're using Castle.Core for method interception within our Autofac IOC in our UWP App.



Thanks for your help,
Peter










share|improve this question














In our UWP App when building the app with .NET Native tool chain activated, we get the following error:



Exception thrown: 'System.Exception' in Castle.Core.dll
An exception of type 'System.Exception' occurred in Castle.Core.dll but was not handled in user code
Method 'TypeBuilder.AddInterfaceImplementation(Type)' was not included in compilation, but was referenced in ClassEmitter..ctor(ModuleScope, string, Type, IEnumerable<Type>, TypeAttributes, bool). There may have been a missing assembly.


Our Default.rd.xml looks like this:



<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
</Application>
</Directives>


I cannot figure out, what I have to add to the Default.rd.xml to make my app works also with the .NET Native tool chain activated.



We're using Castle.Core for method interception within our Autofac IOC in our UWP App.



Thanks for your help,
Peter







uwp castle-dynamicproxy .net-native






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 12:46









Peter WyssPeter Wyss

919




919








  • 1





    While this is legitimate question you will hardly get answer for so specialized solutions, try to ask the provider directly.

    – Ivan Ičin
    Nov 21 '18 at 13:45














  • 1





    While this is legitimate question you will hardly get answer for so specialized solutions, try to ask the provider directly.

    – Ivan Ičin
    Nov 21 '18 at 13:45








1




1





While this is legitimate question you will hardly get answer for so specialized solutions, try to ask the provider directly.

– Ivan Ičin
Nov 21 '18 at 13:45





While this is legitimate question you will hardly get answer for so specialized solutions, try to ask the provider directly.

– Ivan Ičin
Nov 21 '18 at 13:45












1 Answer
1






active

oldest

votes


















4














UWP doesn't support System.Reflection.Emit. It might sometimes work in debug, but does not work in release with .NET Native compilation:




  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/8280606-windows-10-uwp-should-support-reflection-emit-for

  • https://github.com/dotnet/corefx/issues/30127

  • https://github.com/castleproject/Core/issues/374


After the System.Reflection.Emit NuGet package was delisted (temporarily), we (Castle) considered whether DynamicProxy should target .NET Framework and .NET Core directly, and never target .NET Standard, however the .NET team has recently added the emit API to .NET Standard officially, previously it was in the .NET Standard APIs by accident.






share|improve this answer
























  • ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

    – Peter Wyss
    Nov 23 '18 at 11:47













  • That is my understanding, unfortunately.

    – Jonathon Rossi
    Nov 23 '18 at 15:25











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412350%2fuwp-with-castle-core-compile-with-net-native-tool-chain-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














UWP doesn't support System.Reflection.Emit. It might sometimes work in debug, but does not work in release with .NET Native compilation:




  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/8280606-windows-10-uwp-should-support-reflection-emit-for

  • https://github.com/dotnet/corefx/issues/30127

  • https://github.com/castleproject/Core/issues/374


After the System.Reflection.Emit NuGet package was delisted (temporarily), we (Castle) considered whether DynamicProxy should target .NET Framework and .NET Core directly, and never target .NET Standard, however the .NET team has recently added the emit API to .NET Standard officially, previously it was in the .NET Standard APIs by accident.






share|improve this answer
























  • ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

    – Peter Wyss
    Nov 23 '18 at 11:47













  • That is my understanding, unfortunately.

    – Jonathon Rossi
    Nov 23 '18 at 15:25
















4














UWP doesn't support System.Reflection.Emit. It might sometimes work in debug, but does not work in release with .NET Native compilation:




  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/8280606-windows-10-uwp-should-support-reflection-emit-for

  • https://github.com/dotnet/corefx/issues/30127

  • https://github.com/castleproject/Core/issues/374


After the System.Reflection.Emit NuGet package was delisted (temporarily), we (Castle) considered whether DynamicProxy should target .NET Framework and .NET Core directly, and never target .NET Standard, however the .NET team has recently added the emit API to .NET Standard officially, previously it was in the .NET Standard APIs by accident.






share|improve this answer
























  • ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

    – Peter Wyss
    Nov 23 '18 at 11:47













  • That is my understanding, unfortunately.

    – Jonathon Rossi
    Nov 23 '18 at 15:25














4












4








4







UWP doesn't support System.Reflection.Emit. It might sometimes work in debug, but does not work in release with .NET Native compilation:




  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/8280606-windows-10-uwp-should-support-reflection-emit-for

  • https://github.com/dotnet/corefx/issues/30127

  • https://github.com/castleproject/Core/issues/374


After the System.Reflection.Emit NuGet package was delisted (temporarily), we (Castle) considered whether DynamicProxy should target .NET Framework and .NET Core directly, and never target .NET Standard, however the .NET team has recently added the emit API to .NET Standard officially, previously it was in the .NET Standard APIs by accident.






share|improve this answer













UWP doesn't support System.Reflection.Emit. It might sometimes work in debug, but does not work in release with .NET Native compilation:




  • https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/8280606-windows-10-uwp-should-support-reflection-emit-for

  • https://github.com/dotnet/corefx/issues/30127

  • https://github.com/castleproject/Core/issues/374


After the System.Reflection.Emit NuGet package was delisted (temporarily), we (Castle) considered whether DynamicProxy should target .NET Framework and .NET Core directly, and never target .NET Standard, however the .NET team has recently added the emit API to .NET Standard officially, previously it was in the .NET Standard APIs by accident.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '18 at 2:32









Jonathon RossiJonathon Rossi

3,3991528




3,3991528













  • ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

    – Peter Wyss
    Nov 23 '18 at 11:47













  • That is my understanding, unfortunately.

    – Jonathon Rossi
    Nov 23 '18 at 15:25



















  • ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

    – Peter Wyss
    Nov 23 '18 at 11:47













  • That is my understanding, unfortunately.

    – Jonathon Rossi
    Nov 23 '18 at 15:25

















ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

– Peter Wyss
Nov 23 '18 at 11:47







ok thanks for your answer. So basically this means, that we cannot use Castle.Core with our UWP project currently, right?

– Peter Wyss
Nov 23 '18 at 11:47















That is my understanding, unfortunately.

– Jonathon Rossi
Nov 23 '18 at 15:25





That is my understanding, unfortunately.

– Jonathon Rossi
Nov 23 '18 at 15:25




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412350%2fuwp-with-castle-core-compile-with-net-native-tool-chain-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()