Any plans to convert Castle.Core to a PCL? (.NetPortable,Version=4.5,Profile7)

85 views
Skip to first unread message

Jon D

unread,
Sep 28, 2015, 12:08:08 PM9/28/15
to Castle Project Users
Trying to use Autofac.Extras.DynamicProxy2 which is a PCL, but depends on Castle.Core which is not a PCL.

The message states:
Cannot install package Castle.Core 3.2.2. You are trying to install this package to a project that targets .NetPortable, Vertion=4.5,Profile7

I did try downloading the Castle.Core.dll and reference it directly thinking the package simply has not been updated to include the above profile.
It compiles successfully.
But, I get a runtime error:
Cannot load System.Runtime.Serialization.ISerializer (or something to that effect).

Are there any plans to port Castle.Core to PCL ... specifically Profile7?

Jonathon Rossi

unread,
Sep 29, 2015, 2:43:43 AM9/29/15
to Castle Project Users
Assuming Profile7 is .NET Framework 4.5 and Windows 8, it will never work because Win8 Metro apps are missing Reflection.Emit (among others) so DynamicProxy can't do its thing.

There are no plans to support any PCL profile because DP just isn't a simple library, it relies heavily on the runtime, however we are working towards a .NET Core port but from the little I know about Win10/Metro/Modern/WinStore/Universal apps it isn't likely to work their either especially since those are compiled using .NET Native.

Since you said you are using Autofac this doesn't help you, but if you just want to use DP for unit testing via a mocking framework you could use the desktop runtime for unit tests.

--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-u...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.

--
Jono

Jon D

unread,
Sep 30, 2015, 1:05:39 PM9/30/15
to Castle Project Users
Profile 7 is
* .Net Framework 4.5
* ASP.NET Core 5.0
* Windows 8
* Xamarin.Android
* Xamarin.iOS
* Xamarin.iOS (classic)

What I really WANT to target is:
* .Net Framework 4.5
* Windows Universal
* Xamarin.Android
* Xamarin.iOS

... but when I change Windows 8 to Windows Universal 10 (for example), I get the message "The following will be automatically targeted because they support the same set of portable API's: Windows 8"

So, GREAT, I get windows 8 as well ... BUT, apparently Win8 Metro is missing Reflection.Emit?
I wonder if Windows Universal 10 is also missing Reflection.Emit then. (now that I'm curious, I'll have to go look).

I have used Reflection extensively to discover aspects of the Assembly / Class / etc. ... But I have never generated dynamic code at runtime using Emit.
I would have thought iOS would have been the culprit of my angst considering (if my understanding is correct) it not only doesn't allow anything like Emit, but it does not have anything like Reflection either.

Thank you for your response Jono

Reply all
Reply to author
Forward
0 new messages