Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法加载类型“System.Windows.Input.ICommand”_C#_.net_Dll_Autocad_Autocad Plugin - Fatal编程技术网

C# 无法加载类型“System.Windows.Input.ICommand”

C# 无法加载类型“System.Windows.Input.ICommand”,c#,.net,dll,autocad,autocad-plugin,C#,.net,Dll,Autocad,Autocad Plugin,我正在使用Object ARX 2015和.Net Framework编写AutoCad扩展。在我的电脑上一切正常。但是当我尝试在其他计算机上使用我的.dll时。我得到这个错误: 例外文本 System.TypeLoadException:无法加载类型 'System.Windows.Input.ICommand'来自程序集'系统, 版本=4.0.0.0,区域性=中性,PublicKeyToken=b77a5c561934e089'。 位于Extension.MyCommands.KeelRib

我正在使用Object ARX 2015和.Net Framework编写AutoCad扩展。在我的电脑上一切正常。但是当我尝试在其他计算机上使用我的.dll时。我得到这个错误:

例外文本

System.TypeLoadException:无法加载类型 'System.Windows.Input.ICommand'来自程序集'系统, 版本=4.0.0.0,区域性=中性,PublicKeyToken=b77a5c561934e089'。 位于Extension.MyCommands.KeelRibbon 在Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkMethodInfo mi中,对象commandObject,布尔函数 在Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilterMethodInfo中 mi,对象命令对象,布尔函数 在Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.InvokeMethodInfo mi中, 布尔blisp函数 在Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke中


由于该类是.Net Framework的一部分,因此如果安装了正确的.Net版本,则该类应在计算机上可用。我建议采取以下解决方案之一:

确保在另一台计算机上安装了为其编译项目的.Net版本 如果不是这样,并且您无法在此计算机上安装正确的版本,请至少为可用的.Net 3.0版本编译您的项目
希望这对AutoCAD 2015有所帮助,您需要将.NET 4.5设置为Visual Studio项目的目标

您确定DLL包含在输出目录中吗?您没有正确生成此程序集。它是在安装了.NET 4.5的机器上构建的,该项目以.NET 4.0为目标,但使用了错误的引用程序集。必须使用c:\program files x86\reference程序集中的程序集,而不是c:\windows\microsoft中的程序集。net@HansPassant即使生成输出告诉我它使用的是您提到的文件夹中的C:\Program Files x86\Reference Assembly\Microsoft\Framework\.NETFramework\v4.0\System.dll,也可能发生此错误,但是,当用户尝试从System.DLL加载ICommand时,会收到相同的TypeLoadException。