添加插件DLL在MVC 4网站发布后 [英] Add Plugin DLL in MVC 4 Website after publish

查看:121
本文介绍了添加插件DLL在MVC 4网站发布后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用我的主要项目未引用外部DLL。我做了一些测试,它的工作,但现在,我需要自动完成。

I need to use external DLL not referenced in my main project. I've made some tests and it's working but now, I need to do it automatically.

所以,在我的我的主要Web项目的后生成事件,我把这个:

So, in my "Post Build" event of my main web project, I put this :

Call c:\mybat.bat  $(SolutionDir) $(TargetName) $(Configuration)

和在C:\\ mybat.bat,我有这样的:

And in c:\mybat.bat, I've this :

set solution=%~1
set target=%~2
set configuration=%~3

set appli=Project1
rem : MSBuild...
cd "%solution%%appli%" && "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MsBuild.exe" "%solution%%appli%\%appli%.csproj" /p:Configuration=%configuration%  /p:Platform="AnyCPU"

rem copy DLL generate by build
xcopy /Y /R "%solution%%appli%\bin\%appli%.dll" "%solution%%target%\bin\%appli%.dll*"
rem copy views...
xcopy /Y /R /S "%solution%%appli%\Views\*.*" "%solution%%target%\Views\"

和它的伎俩。

但是,当我发表我的网站,该DLLProject1.dll是不是在我的网站\\ bin文件夹。只有在我的宾项目解决方案。

But, when I publish my website, the DLL 'Project1.dll' is not in my 'website\bin' folder. Only in my Bin project solution.

我如何添加我的* .dll和我的观点文件夹中的发布文件?

How can I add my *.dll and my view folder in the publish files ?

推荐答案

您必须将这些文件包括到您的项目,发布仅复制的文件的MSBuild的过程中意识到(即它一直是项目本身的一部分)

You have to include those files into your project, as publish copies only files which the msbuild process is aware of (i.e. which have been part of the project itself).

另一种选择可能是有更新的MSBuild目标文件(包括自定义/ enhaned目标项目中的文件)。

Another option might be to have the msbuild target file updated (by including custom/enhaned targets in your project file).

http://stackoverflow.com/a/1403360/2298807 的包含可能被用来作为文章的列表一个出发点这个。

http://stackoverflow.com/a/1403360/2298807 contains a list of articles which might be used as a starting point for this.

这篇关于添加插件DLL在MVC 4网站发布后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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