我正在使用VS 2010 Ultimate,但出现此错误
问题描述:
"/RetriveData"应用程序中的服务器错误.
-------------------------------------------------- ------------------------------
无法加载文件或程序集"firebirdsql.data.firebirdclient"或其依赖项之一.此程序集是由比当前加载的运行时新的运行时构建的,无法加载.
Server Error in ''/RetriveData'' Application.
--------------------------------------------------------------------------------
Could not load file or assembly ''firebirdsql.data.firebirdclient'' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
答
错误消息包含您需要的所有信息:
"...此程序集由比当前加载的运行时新的运行时生成,无法加载..."
这实际上表示您在项目中定位的.NET版本比目标Firebird程序集的.NET版本要小.
示例1:您的项目是.NET 2.0,而Firebird程序集是使用.NET 4.0编译的.
结果1:将不起作用.
示例2:您的项目是.NET 4.0,而Firebird程序集是使用.NET 2.0编译的.
结果1:将起作用.
简而言之:不能从较低的.NET版本项目中使用较高的.NET版本程序集,但相反,这是允许的.
问候,
曼弗雷德(Manfred)
The error message contains all the information you need:
"...This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..."
This essentially says that you are targeting a .NET version in your project that is less than the the .NET version the Firebird assemblies where targeted for.
Example 1: Your project is .NET 2.0 and the Firebird assembly was compiled with .NET 4.0
Result 1: Will not work.
Example 2: Your project is .NET 4.0 and the Firebird assembly was compiled with .NET 2.0
Result 1: Will work.
In short: You can''t use a higher .NET version assembly from a lower .NET version project, but the other way it is permissible.
Regards,
Manfred