开发者

Deploying Web service to : Mono 500 - Internal Server Error

开发者 https://www.devze.com 2023-01-05 11:47 出处:网络
I developed a webservices using Visual Studio 2008 with C# and C++. I deploy it to mod_mono, the services is loaded, but when I try to run a method using Invoke button I get the error below, I have t

I developed a webservices using Visual Studio 2008 with C# and C++.

I deploy it to mod_mono, the services is loaded, but when I try to run a method using Invoke button I get the error below, I have tested with MoMA without any error:

500 - Internal Server Error

System.TypeInitializationException: An exception was thrown by the type initializer for <Module> ---> System.MissingMethodException: Method contains unsupported native code

  at (wrapper managed-to-native) <Module>:<CrtImplementationDetails>.ThrowModuleLoadException (string,System.Exception)

  at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails开发者_如何转开发>.LanguageSupport* ) [0x00000]

  at <Module>..cctor () [0x00000]

  --- End of inner exception stack trace ---

  at I3WebService.Service1.Inferece (System.String value) [0x00000]

  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)

  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]

Thank you.

Some more error message, when I use php to call the webservice:

(/usr/lib/mono/2.0/mod-mono-server2.exe:1941): WARNING **: Method '<Module>:network.{ctor} (network*)' in assembly '/usr/local/zend/tmp/apache-temp-aspnet-0/54ae108a/assembly/shadow/a7cd17e2/c0c678fa_670b6f18_00000002/engine.dll' contains native code that cannot be executed by Mono on this platform. The assembly was probably created using C++/C


I think the error messages are plenty clear here.

contains native code that cannot be executed by Mono on this platform. The assembly was probably created using C++/C

You can't use C++/CLI on the Mono platform unless that C++/CLI module was compiled ON that Mono platform. Mono itself is platform independent but the native code in your assembly is not.

C++/CLI actually is a way of mixing native code with managed code -- the runtime handles all the P/Invoke stuff behind the scenes but it's still there and you can't forget about it just because it's not directly exposed in the language.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号