Re: System.InvalidOperationException when calling valueOf on any enum class
Matt Bastress <[email protected]>
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <CACpaFyscMhP_R0Jo9axm3UVv+wYMV1f627NGT7m6dCzDbqv+xw@mail.gmail.com> |
Hi, Yes, is it possible or do I need to limit functionality to a subset of Java (i.e. no reflection)? We're hoping to port some model classes and logic written in Java to our Windows Store app. Thanks, Matt On Wed, Jan 29, 2014 at 8:01 AM, Jeroen Frijters <[email protected]> wrote: > Hi, > > Are you trying to use the ikvmc compiled dll from a "modern" app? > > Regards, > Jeroen > > > -----Original Message----- > > From: Matt Bastress [mailto:[email protected]] > > Sent: Wednesday, January 29, 2014 13:17 > > To: [email protected] > > Subject: [Ikvm-developers] System.InvalidOperationException when calling > > valueOf on any enum class > > > > Hi, > > > > > > When using MyEnum.valueOf(String) to create an enum instance, after > > using ikvmc to create a DLL and running on the Windows 8.1 platform, I > > get a System.InvalidOperationException and a message, "The API > > 'System.Exception.get_TargetSite()' cannot be used on the current > > platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more > > information." This is the stack trace: > > > > at > > System.Reflection.Emit.DynamicILGenerator.GetTokenFor(RuntimeMethodInfo > > rtMeth) > > at System.Reflection.Emit.DynamicILGenerator.Emit(OpCode opcode, > > MethodInfo meth) > > at IKVM.Internal.CodeEmitter.RealEmitOpCode(OpCode opcode, Object > > arg) > > at IKVM.Internal.CodeEmitter.OpCodeWrapper.RealEmit(Int32 ilOffset, > > CodeEmitter codeEmitter, Int32& lineNumber) > > at IKVM.Internal.CodeEmitter.DoEmit() > > at > > IKVM.NativeCode.sun.reflect.ReflectionFactory.FastMethodAccessorImpl..ct > > or(Method method, Boolean nonvirtual) > > at > > IKVM.NativeCode.sun.reflect.ReflectionFactory.newMethodAccessor(Object > > thisFactory, Object method) > > at sun.reflect.ReflectionFactory.newMethodAccessor(Method m) > > at java.lang.reflect.Method.acquireMethodAccessor() > > at java.lang.reflect.Method.invoke(Object obj, Object[] args, > > CallerID ) > > at java.lang.Class.getEnumConstantsShared() > > at java.lang.Class.enumConstantDirectory() > > at java.lang.Enum.valueOf(Class enumType, String name) > > at > > com.casenet.external.portable.common.configuration.AttributeType.valueOf > > (String name) > > > > Thanks for any help. > ------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk _______________________________________________ Ikvm-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ikvm-developers