使用清单工具(mt.exe)更改“版本” “非托管程序集”
现在本机代码可以拥有程序集(例如“非托管程序集”)对于并行缓存的使用,我有兴趣在构建 DLL 后更改其版本(作为增量构建自动版本控制方案的一部分)。我认为我已经接近使用此命令:
mt -updateresource:MyNewlyBuiltThing.dll;#2 -identity:"MyNewlyBuiltThing, version=5.5.0.1"
该命令给出以下错误:
mt.exe:一般错误 c101008d:无法将更新的清单写入文件“MyNewlyBuiltThing.dll”的资源。访问被拒绝。
该命令是从具有管理员权限的命令提示符执行的,并且我的开发盒上没有防病毒软件(并且该文件没有设置只读标志)。
也许问题是我在身份字符串中使用了错误的名称。毕竟,当我将二进制文件的嵌入资源加载到 Visual Studio 中时,它会显示一个清单,而不会提及其名称 - 它只提及依赖项的名称。
不管怎样,我只是想知道是否可以诱使 mt.exe 为我提供非托管程序集的构建后版本碰撞。对我做错了什么有任何见解吗?如果这不可能,为什么?
Now that native code can have assemblies (e.g. "unmanaged assembly") for side-by-side cache usage, I'm interested in changing the version of a DLL after it is built (as part of an incremental build auto-versioning scheme). I think I'm close using this commmand:
mt -updateresource:MyNewlyBuiltThing.dll;#2 -identity:"MyNewlyBuiltThing, version=5.5.0.1"
That command gives me the following error:
mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "MyNewlyBuiltThing.dll". Access is denied.
That command is executed from a command prompt with administrator privileges, and I have no anti-virus software on my development box (and the file does not have a read-only flag set).
Perhaps the problem is that I'm using the wrong name in the identity string. After all, when I load the embedded resource of the binary into Visual Studio, it shows a manifest that doesn't bother to mention its name - it only mentions the names of dependencies.
Anyway, I was just wondering if the mt.exe could be coaxed into giving me the post-build version-bumping of a non-managed assembly. Any insight of what I'm doing wrong? And if this is not possible, why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果权限问题已排除:
您是否在 FAT 文件系统上运行?如果不在 NTFS 上,可能会出现问题。此外,最新的 mt.exe(属于 "适用于 Windows 7 和 .NET Framework 4 的 Microsoft Windows SDK",版本 7.1 所以您可以尝试一下。
If permissions issues have been ruled out:
Are you running on a FAT filesystem? There may be issues if not on NTFS. Also, several issues of this type are gone with the latest mt.exe, part of the "Microsoft Windows SDK for Windows 7 and .NET Framework 4", version 7.1 so you could try that.