Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Framework 4.0 Problem at .net Connector 3.0

former_member212713
Contributor
0 Kudos

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:

1 ACCEPTED SOLUTION

eduardo_gironas
Participant
0 Kudos

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.

5 REPLIES 5

eduardo_gironas
Participant
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

Did you manage to solve the issue, I am also getting the same now, can you please help in this.

0 Kudos

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.

Former Member
0 Kudos

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>