ASP.NET 网站中的多文件 c++/cli .net 程序集
我有一个 .NET 程序集,我想在 ASP.NET 网站中使用它。该程序集具有以下特征:
- 用 C++/CLI 编写,
- 包含编译到 x86/x64 平台的托管和非托管代码
- (使用正确的特定于平台的程序集,因此这里不认为是问题)
- 编译为多文件程序集链接几个本机 dll
当我尝试编译时,出现错误:
无法加载文件或程序集“...”或其依赖项之一。尝试加载格式不正确的程序。
我可以在 ASP.NET Web 应用程序(例如 MVC)中毫无问题地使用库引用,但是当我想在 ASP.NET 中使用它时网站上,我遇到了这个编译问题。它似乎与 ASP.NET 编译器特别相关。
如何让我的网站使用此依赖项进行编译?
I have a .NET assembly that I want to use in an ASP.NET web site. The assembly has the following characteristics:
- written in C++/CLI
- contains managed and unmanaged code
- compiled to x86/x64 platforms (using the correct platform-specific assembly, so it's not believed to be an issue here)
- compiled as a multi-file assembly linking several native dlls
When I try to compile I am getting an error stating:
Could not load file or assembly '...' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I can use the library reference without problems in an ASP.NET web application (such as MVC), but when I want to use it in an ASP.NET web site, I get this compilation issue.It seems to be something specifically related to the ASP.NET compiler.
How do I get my website to compile with this dependency?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Visual Studio 中没有看到任何编译设置来指示某种方式...
I don't see any compilation settings within Visual Studio to indicate one way or another...