【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文件是否存在异常 ...
随机推荐
- 《C++ Primer Plus》第4章 学习笔记
数组.结构和指针是C++的3中符合类型.数组可以在一个数据对象中存储多个同种类型的值.通过使用索引或下标,可以访问数组中各个元素.结构可以将多个不同类型的值存储在同一个数据对象中,可以使用成员关系运算 ...
- 模拟window桌面实现
正在开发中的游戏有个全屏功能--可以在window桌面背景上运行,就像一些视频播放器在桌面背景上播放一样的,花了个上午整了个Demo放出来留个纪念. 实现功能:显示图标,双击图标执行相应的程序,右击图 ...
- spring基础---->spring自定义标签(一)
Spring具有一个基于架构的扩展机制,可以使用xml文件定义和配置bean.本博客将介绍如何编写自定义XML bean的解析器,并用实例来加以说明.其实我一直相信 等你出现的时候我就知道是你. Sp ...
- 【BZOJ2424】[HAOI2010]订货 最小费用流
[BZOJ2424][HAOI2010]订货 Description 某公司估计市场在第i个月对某产品的需求量为Ui,已知在第i月该产品的订货单价为di,上个月月底未销完的单位产品要付存贮费用m,假定 ...
- idea下maven项目增加依赖项目里面没有添加相关依赖jar
困扰了一晚上的问题,一般在pom.xml中增加了相关依赖,idea会自动将依赖的Jar包增加到maven项目中,但是在pom.xml中增加了依赖,项目中并没有 偶然打开idea的侧边栏maven工具栏 ...
- JSTL-标准标签库
JSTL1.2中的标签库可以分成5类区域 核心:uri="http://java.sun.com/jsp/jstl/core" prefix=“c” XML: ...
- Python全栈day20(解压序列)
补充:解压序列 需求一,不通过索引取一个列表的第一个元素和最后一个元素 需求二,交换两个变量的值 L=[1,2,3,4,5,6,7,8,9] #把列表第一个元素赋值给a,最后一个元素赋值给c #中间的 ...
- Python全栈day19(函数补充)
一,深浅拷贝 看拷贝列子day19-1.py s=[1,'zhangsan','lisi'] #s2是s的拷贝 s2=s.copy() #打印s2和s是一样的 print(s2) #修改s2 s2[0 ...
- HDU 3450 Counting Sequences(线段树)
Counting Sequences Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/65536 K (Java/Other ...
- 【Python之路】Python目录
Python基础1 -- Python由来.Python种类.编码方式, Python基础2 -- Python运算符.数据类型.enumerate.range.for循环 python基础3 -- ...