非托管C ++ - 需要强名称由C ++ / CLI dll用强名称引用? [英] Unmanaged C++ - need strong name to be referenced by C++/CLI dll with strong name?

查看:291
本文介绍了非托管C ++ - 需要强名称由C ++ / CLI dll用强名称引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非托管的C ++ dll,它将被托管的C ++ / CLI包装程序.dll使用,最终将被C#项目使用。

I have a unmanaged C++ dll, which will be used by a managed C++/CLI wrapper .dll, which will eventually be used by a C# project.

项目是强命名的,所以是包装器.dll。我试着做相同的非托管dll,使用/ KEYFILE,但似乎不工作。并且包装器正在抱怨:

C# project is strong-named, so is the wrapper .dll. I tried doing the same for the unmanaged dll, using /KEYFILE, but doesn't seem to work. And the wrapper is complaining:

.... is a strong-name signed assembly and embedding a manifest invalidates the signature

我需要强名称非托管C ++吗?如果没有,我该如何解决这个问题?

Do I need to strong-name the unmanaged C++ at all? If not, how do I resolve this issue?

推荐答案

最重要的是因为这样做是没有意义的,只有CLR将验证一个强名称,并且只在.NET程序集上这样做。

It is not possible to strong-name a native DLL. Most of all because doing so is meaningless, only the CLR will ever validate a strong name and only does so on .NET assemblies.

替代代码签名证书。最大的提示是这样的,因为你不必把一大堆钱交给任何人。

Just in case: a strong name is not a substitute for a code-signing certificate. Biggest hint this is so because you don't have to hand over a big wad of money to anyone.

这篇关于非托管C ++ - 需要强名称由C ++ / CLI dll用强名称引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆