c sharp 中调用mo如何解决引用问题?

Step 1: Run "REGEDIT" from the Command Prompt or the Windows "Start | Run..." menu item and navigate to this key: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework In this key are a few different values on the right-side panel, one of them is named "sdkInstallRootv1.1". The value to the right of this name is the absolute path on your machine's disk where "bin/gacutil.exe" is stored. In a typical default installation of .NET, the path in this key's value might look something like this: "C:/Program Files/Microsoft Visual Studio .NET 2003/SDK/v1.1/"

Step #2: In the right side panel of the Registry Editor, left-click to select the "sdkInstallRootv1.1" in the "Name" column. Then go up to the "Edit" menu and select "Modify", which will open a new smaller window called "Edit String".

Step #3: In the "Edit String" window, use your mouse to highlight and select the entire contents of the "Value Data" text box, then use [Ctrl] + C to copy that string to the clipboard. Then hit the "Cancel" button to dismiss this "Edit String" window.

Step #4: Go back to the left panel of the Registry Editor panel and left-click on the ".NETFramework" key to select it. Then go to the "Edit" menu and select "New...", which opens a menu to the right in which you should choose the menu item which says "String Value".

Step #5: A new entry will be made in the "Name" column of the right panel of the Registry Editor called "New Value #1" ready to edit. Change its name to "sdkInstallRoot". If it won't let you edit the name, then right-click on "New Value #1" and select "Rename" from the popup menu, then type in the new name "sdkInstallRoot" and hit [Enter] to make the name change.

Step #6: Right-click on your new name "sdkInstallRoot", and select "Modify" from the popup menu. Single-click your mouse into the text box below "Value Data", then use [Ctrl] + V to paste in the path string which you copied into the clipboard back in Step #3 above. Then click the OK button to finish the edit and dismiss the small "Edit String" window.

大体翻译:打开注册表(在windows开始的运行中键入regedit),打开(找到)HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework 这一项,新建一个字符值"sdkInstallRoot”,为这个字符值修改数据为字符值为"sdkInstallRootv1.1"的数据值.我成功了,然后安装MO2.2,MO2.2的SDK .net的支持选项就可选安装了 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ReoScript 是一种基于 ECMAScript 的脚本语言,它本身并不支持直接调用 C# 的方法。不过,你可以通过以下方法在 ReoScript 脚本调用 C# 的方法: 1. 使用 ReoScript 提供的扩展功能:ReoScript 可以通过扩展功能调用其他语言的方法,包括 C#。你可以通过在 C# 定义一个类,并将其注册到 ReoScript ,然后在 ReoScript 脚本通过该类的实例来调用 C# 的方法。以下是一个示例: 在 C# 定义一个类: ```csharp public class MyCSharpClass { public int Add(int a, int b) { return a + b; } } ``` 在 ReoScript 注册该类并调用其方法: ```javascript // 将 MyCSharpClass 类注册到 ReoScript var cs = new MyCSharpClass(); var ctx = reoScript.createContext(); ctx.cs = cs; // 在 ReoScript 调用 MyCSharpClass 类的 Add 方法 var result = ctx.cs.Add(1, 2); console.log(result); // 输出:3 ``` 2. 使用 ReoScript 的 COM 功能:如果你的 C# 类库是一个 COM 组件,你可以在 ReoScript 使用 COM 功能调用的方法。以下是一个示例: 在 C# 定义一个 COM 组件: ```csharp [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] public class MyComClass { public int Add(int a, int b) { return a + b; } } ``` 在 ReoScript 调用该 COM 组件的方法: ```javascript // 获取 COM 组件的类型库 var myComTypeLib = reoScript.COM.getTypeLib('MyComClass'); // 创建 COM 组件的实例 var myComInstance = myComTypeLib.newInstance(); // 调用 COM 组件的 Add 方法 var result = myComInstance.Add(1, 2); console.log(result); // 输出:3 ``` 注意:使用 COM 功能需要在 ReoScript 的配置文件启用该功能。具体请参考 ReoScript 的文档。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值