如果我可以运行依赖于.net编写的dll的应用程序,我需要什么 [英] what's dll I need if I can run app which depend on dll written in .net

查看:78
本文介绍了如果我可以运行依赖于.net编写的dll的应用程序,我需要什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用C ++(QT)开发一个应用程序,但现在一个功能需要.Net的东西,然后我写了一个VC ++ CLR项目的dll(vs2010,.Net4.0)作为.Net的包装,只导出1函数by



 _declspec(dllexport)void previewDocx(const char * lp); 





然后app(exe)链接lib并依赖于dll。



在我的本地,应用程序正常运行。但是在其他电脑上失败了。(没有安装vs2010或.Net框架)。



我试图在C:\Program Files(x86)下添加所有dll )\ Microsoft Visual Studio 10.0\VC \\ [remist运行目录(bin)。



但是当调用.Net dll中的代码时,它崩溃了。



BTW。

(1)exe由QT重新分配,所以没有msi,我只想带一些nesseary东西(与现有的自解压一样的dll等。我可以吗?

(2)我是否让用户安装.Net framework 4.0?任何简单的解决方案?



提前感谢?

解决方案

你必须要求客户安装 .net4 [ ^ ]在这个例子中





(整个.net可用性/安装范例是一个混乱的IMO)


您可以在您的应用程序中部署.NET框架。请从这里开始: https://msdn.microsoft.com/en- us / library / 6hbb4k3e%28v = vs.100%29.aspx [ ^ ]。



对于安装,我通常建议使用开源WiX:< br b> ^ ],

http://wixtoolset.org/ [ ^ ]。



请注意,WiX比停止与Visual Studio捆绑的安装项目更合法。 WiX是一个更好的项目。它与MSBuild正确集成,符合MSBuild项目文件的标准(而安装项目类型不符合)。它还具有出色的Visual Studio集成。安装项目的可维护性也要好一些。



因此,您可以使用WiX部署.NET: http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_dotnet.html [ ^ ]。



当然,你只需要声明所需版本的.NET框架作为你的应用程序的先决条件。







另一个有用的想法可能是使用WiX#:

https://wixsharp.codeplex .com [ ^ ],

< a href =http://www.codeproject.com/Articles/804584/Wixsharp-WixShar p-UI-Extensions> Wix#(WixSharp)UI扩展 [ ^ ]。





-SA

I develop a app in C++(QT),but now a feature need .Net stuff,then I write a dll of VC++ CLR project(vs2010,.Net4.0) as a wrapper for .Net, and export only 1 function by

_declspec(dllexport) void previewDocx(const char* lp);



then the app(exe) link the lib and depend that dll.

In my local,the app runs normally.but failed in other pc.(with no vs2010 nor .Net framework installed).

I have tried to add all the dlls under "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist" to run directory(bin).

But when calling the code inside the .Net dll,it crashed.

BTW.
(1) the exe is redistribute by QT so there's no msi,I just want to carry some nesseary stuff (dll,the like) with the existing self-extracting. May I?
(2)Do I acquired to let the user to install .Net framework 4.0? any simple solution?

thanks in advance?

解决方案

you'll have to ask the client to install .net4[^] in this instance


(the whole .net availability/install paradigm is a mess IMO)


You can deploy .NET framework with your application. Please start here: https://msdn.microsoft.com/en-us/library/6hbb4k3e%28v=vs.100%29.aspx[^].

For installations, I usually recommend open-source WiX:
http://en.wikipedia.org/wiki/WiX[^],
http://wixtoolset.org/[^].

Note that WiX is more legitimate than discontinues Setup project which was bundled with Visual Studio. WiX is much better project. It is correctly integrated with MSBuild and is compliant with the standard for MSBuild projects files (and Setup project type is not). It also has excellent Visual Studio integration. Maintainability of setup project is also by the order of magnitude better.

So, you can deploy .NET with WiX: http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_dotnet.html[^].

But of course you simply can claim required version of .NET framework as a prerequisite for your application.

[EDIT]

Another useful idea could be using WiX#:
https://wixsharp.codeplex.com[^],
Wix# (WixSharp) UI Extensions[^].


—SA


这篇关于如果我可以运行依赖于.net编写的dll的应用程序,我需要什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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