Failed to load a .NET assembly

조회 수: 9 (최근 30일)
Mauro Gandolfo
Mauro Gandolfo 2011년 7월 27일
When I try to load a .NET assembly by typing:
asm = NET.addAssembly('fullPath');
I get the following error: "Could not load file or assembly 'file:///fullPath' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Source: mscorlib HelpLink:"
I've Matlab R2010a and the assembly is targeted for .NET framework 4.0.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 8월 1일
What version of MATLAB did you use to build your .NET assembly? The latest version (R2011a) supports .NET Framework 4.0: http://www.mathworks.com/products/netbuilder/requirements.html, but I know that older releases used older .NET versions. You might need to build with a newer version to load your assembly with 4.0.
  댓글 수: 2
Mauro Gandolfo
Mauro Gandolfo 2011년 8월 1일
Thanks for your answer, but I'm a bit confused. What do you mean for building with MATLAB? For building the .NET assembly I've used Visual Studio targeting the .NET 4.0 framework. I'm trying to add the assembly to MATLAB with the 2010a release and to use its functionalities.
Kaustubha Govind
Kaustubha Govind 2011년 8월 2일
Oops. Apologies! I misunderstood your question.
The issue you are facing has been documented at http://www.mathworks.com/support/solutions/en/data/1-CNPYZV/index.html
So it looks like you will need to upgrade to R2011a to be able to use .NET 4.0 assemblies.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Microsoft .NET에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by