【VS Error】VS2008在编译时出现:Error 15 Cannot register assembly
现象:
在visual studio 2008在编译类库时提示如下错误:
Error 15 Cannot register assembly "D:\01_Work\02_SVN\OCRplatform\trunk\code\OCR.FileTransCommon\bin\Debug\OCR.FileTransCommon.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\OCR.FileTransCommon.FileEntity' is denied. OCR.FileTransCommon
MSDN解释:
Hello
Regsvr32, Regasm, and the registration method used by Visual Studio do not give the choice to register COM per-user because they have no per-user or per-system context, so they have to be elevated to register the component.
A possible workaround is to add a MSI setup project. An MSI setup can choose per-user or per-system because there is infrastructure that supports it at install time and gives the installing user a choice.
1. uncheck the Register for COM interop option.
2. add a setup project (Other Project Types / Setup and Deployment / Setup Project)
3. Right-click the Setup project, select Add / Project Output / Primary output of your COM project.
4. Select Primary output of your COM project in the Solution Explorer, and display its properties. Set the Register property to be vsdrpCOM.
5. By default, the setup project always gives the UAC dialog, even though you install it per user. To turn off UAC compilance, you need to use Orca, a tool provided by Windows SDK.
6. After you install and launch Orca, open the resulting msi file.
7. In the View menu, select Summary Information, and uncheck the UAC Compilant option.
8. Save and close Orca
9. Run the setup project. Change the installation folder from the default C:/Program Files/... to a folder that is not restricted by UAC.
Please let me know whether this works for you.
Another option:
1. still uncheck the Register for COM interop option.
2. instead of using a msi setup project, use a .reg file to register COM component to per-user profile. You can prepare a .REG file with all needed regsitry keys for the COM component. Next, import regsitry by using the REG.exe tool:
reg.exe import <your reg file>
按照上述9步即可解决问题。
或者终极方法:将类库项目右键->Properities->Build中的Register for COM interop选项去掉然后重新编译。
【VS Error】VS2008在编译时出现:Error 15 Cannot register assembly的更多相关文章
- android 6.0编译时出现ERROR:Security problem ,see jack server log【转】
本文转载自:http://blog.csdn.net/a567890k/article/details/52956798 最近编译Android6.0时经常出现以下错误 临时解决方法: Buildin ...
- 解决办法:CMake编译时出现“error in configuration process project files may be invalid”
无论是CMake2.84 还是当前最新的CMake2.87都可能会出现这种错: 查遍国内外的网上都没有给出可行办法,结果还是自己解决了 现把出错原因和解决办法如下:出错原因:因是英文版本,通常安装没有 ...
- 升级到JDK8,编译时发生 Error:java: java.lang.ExceptionInInitializerError
编译的时候出现这个问题.使用1.7的jdk没问题,但是由于po主的项目中,使用了java8编写的代码,解决java8兼容问题成为解决这个问题的首选方案. 这个日志太过简单,只告知一个异常信息,这个异常 ...
- Vue使用Typescript开发编译时提示“ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'afterCompile' of undefined”的解决方法
使用Typescript开发Vue,一切准备就绪.但npm start 时,提示“ ERROR in ./src/main.tsModule build failed: TypeError: Cann ...
- 《OpenGL编程指南第七版》学习——编译时提示“error C2381: “exit” : 重定义;__declspec(noreturn) 不同”错误的解决办法
解决办法一. #if defined(_WIN32) # ifndef GLUT_BUILDING_LIBextern _CRTIMP void __cdecl exit(int); 上面是glut. ...
- libevent在windows下用visual studio编译时出现error C2894错误的原因与解决方法
libevent是一个使用很广泛的网络库,今天想了解下它.于是去git clone了一份源码,用vs2005的命令行:nmake -f makefile.nmake编译之,顺利编译通过,生成三个静态库 ...
- php安装编译时 configure: error: Cannot find OpenSSL's <evp.h>
=============================================== yum install error: protected multilib versions error ...
- make only output error/warning message( 编译时,只输出错误信息和警告信息)
make > /dev/null 这样,正常的信息被重定向输出到/dev/null,错误和警告信息会输出到标准错误设备(standard error,相对于标准输入/输出设备来说).
- Qt 编译时遇到 error: [debug/qrc_music.cpp] Error 1
第一种方式,清理编译文件 把Qdebug release 文件件都删除, 删除makefile 文件 尝试重新编译 以上是网上寻找的结果 以下是我的解决方法 如果还抱错,请检查qrc文件是否存在异常 ...
随机推荐
- JSP内置对象——request 及其响应get和post请求的实例
request对象客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应.它是HttpServletRequest类的实例.request对象具有请求域,即完成客户端的 ...
- Linux 下8种优秀的屏幕录制机
导读 屏幕录制机已经成为常见的和良好的实践来记录一个重要桌面会话,例如,你想玩一个难度较大的游戏,并且向记录是如何完成的,或者你打算创建一个视频教程,入门文章或指南,或任何其他活动和记录你的桌面会话, ...
- 延迟加载JavaScript
上代码: 这段代码放到HTML文档的</body>标签之前(靠近HTML文档底部).外部脚本的名称为defer.js. <script type="text/javascr ...
- 转载 Mixed Content Page
网站配置了https之后,网页上的百度地图无法正常显示,报错类似于: Mixed Content: The page at 'https://url_1' was loaded over HTTPS, ...
- 01.ActiveMQ安装部署
1.下载安装ActiveMQ 下载地址:http://activemq.apache.org/download-archives.html选择相应的版本,笔者选择的是:apache-activem ...
- 将工程导入到SVN仓库
1.在桌面右键点开Tortoise客户端 2.选择仓库 3.在仓库的trunk目录下为新工程创建文件夹
- 如何使用java指令执行含package的class文件
代码文件存放在E:/Temp/JAVA_TEMP/tmp文件夹,代码如下: package tmp; public class Temp { public static void main(Strin ...
- SignalR循序渐进(三)简易的集群通讯组件
上一篇演示了泛型Hub的实现,微软于6月17日更新了SignalR 2.1.0,然后自带了泛型Hub,于是就不需要自己去实现了…(微软你为啥不早一个月自带啊…).不过没关系,SignalR出彩之处不在 ...
- Apache Samza - Reliable Stream Processing atop Apache Kafka and Hadoop YARN
http://engineering.linkedin.com/data-streams/apache-samza-linkedins-real-time-stream-processing-fram ...
- 【转】浏览器Request Header和Response Header的内容
1)请求(客户端->服务端[request]) GET(请求的方式) /newcoder/hello.html(请求的目标资源) HTTP/1.1(请求采用的协议和版本号) Ac ...