2011 Mar 24 6:45 AM
Hi Experts;
I'm trying .net Connector 3.0v on Vs.net 2010 and framework 4.0 platforms.
But I'm taking the following errors.
Isn't .net Connector 3.0 working on the framework 4.0v ?
Do It want to framework 2.0?
Thanks for your interest.
Error Message :
System.TypeInitializationException was unhandled
Message=The type initializer for 'SAP.Middleware.Connector.RfcDestinationManager' threw an exception.
Source=sapnco
TypeName=SAP.Middleware.Connector.RfcDestinationManager
StackTrace:
at SAP.Middleware.Connector.RfcDestinationManager.RegisterDestinationConfiguration(IDestinationConfiguration config)
at ConsoleApplication3.Program.Main(String[] args) in c:\documents and settings\mutlum\my documents\visual studio 2010\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:line 44
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeInitializationException
Message=The type initializer for 'SAP.Middleware.Connector.RfcConfigParameters' threw an exception.
Source=sapnco
TypeName=SAP.Middleware.Connector.RfcConfigParameters
StackTrace:
at SAP.Middleware.Connector.RfcConfigParameters.Initialize()
at SAP.Middleware.Connector.RfcDestinationManager..cctor()
InnerException: System.IO.FileLoadException
Message=Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. Source=sapnco
StackTrace:
at SAP.Middleware.Connector.RfcConfigParameters..cctor()
InnerException:
2011 Mar 24 2:57 PM
Melih, verify the next things:
1) Did you download the right Connector Assembly? (Connector 3.0 for Framework 4)
2) Is the Project Properties -> Application -> Target Framework pointing to .NET FrameWork 4?
3) May be, it is necessary to include the next in the app.config or web.config:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Regards.
2011 Mar 24 2:57 PM
Melih, verify the next things:
1) Did you download the right Connector Assembly? (Connector 3.0 for Framework 4)
2) Is the Project Properties -> Application -> Target Framework pointing to .NET FrameWork 4?
3) May be, it is necessary to include the next in the app.config or web.config:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Regards.
2013 Oct 14 7:58 PM
Hello Mr. Eduardo Gironas.,
I Am Also Having The Same Problem. Your Solution Of Adding XML Tags With Values To APP.Config File Is Solved My Problem. Thanks.
2011 Jun 01 3:20 PM
Did you manage to solve the issue, I am also getting the same now, can you please help in this.
2011 Oct 25 3:11 PM
Can someone please update this thread if they found the solution? I am facing the same issue. The code runs fine on my local dev machine, but the server throws the exception mentioned.
2014 Nov 14 1:47 AM
I have the same issue, but I solve it using the following method. I hope it is good for you.
.NET Framework 4 不能自动使用自己的公共语言运行时版本来运行由 .NET Framework 早期版本生成的应用程序。 若要使用 .NET Framework 4 运行较早的应用程序,则必须使用 Visual Studio 中项目的属性指定的目标 .NET Framework 版本编译应用程序, 或使用应用程序配置文件中的 <supportedRuntime> 元素 可指定所支持的运行时。
解决方案,就是在app.config中添加一个配置节:startup
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>