简体   繁体   English

使用C#迁移项目时在VS 2010中添加参考dll时出错

[英]Adding reference dll in VS 2010 got error when migrating the project using C#

I add reference from the project -> add reference and when running the program it's ok, but when I try to migrate my project folder to another computer. 我从project add reference -> add reference ,运行程序时可以,但是当我尝试将项目文件夹迁移到另一台计算机时。 I will get this error 我会得到这个错误

    `Retrieving the COM class factory for component with 
     CLSID {20B43BA5-9CE9-42E1-9A56-B049C8828B1C} 
     failed due to the following error: 
       80040154 Class not registered 
     (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).`

and the reference folder I added the dll from, has a yellow punctuation icon, how can I possibly fix this? 并且我从中添加了dll的参考文件夹有一个黄色的标点符号图标,我该如何解决?

I copy the dll to the pc that where i migrated my project and then when I add the dll this give me error tsssk 我将dll复制到移植项目的PC,然后在添加dll时出现错误tsssk

屏幕截图

It sounds like the reference location is not available on the new machine. 听起来参考位置在新机器上不可用。 Verify that the reference file and the location are on the new machine. 验证参考文件和位置在新计算机上。

If they are, remove and re-add the reference. 如果它们是,删除并重新添加引用。

When you change to location of project or move your visual studio project from one location to another location. 当您更改到项目的位置或将Visual Studio项目从一个位置移动到另一位置时。 then it checks the Private assembly references you have added in your project on the location where you were using from last time. 然后它将检查您上次使用的位置上已添加到项目中的私有程序集引用。 so to solve this just add these references again or put the ref library's into the location where visual studio is seeking for. 因此,要解决此问题,只需再次添加这些引用,或将引用库放入Visual Studio寻找的位置。

better to create a folder under you project and add all your local assemblies into that and add ref from here. 最好在项目下创建一个文件夹,然后将所有本地程序集添加到该文件夹​​中,然后从此处添加引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM