Visual Studio包生成和私有bin路径中的DLL [英] Visual Studio Package build and DLLs in private bin path

查看:170
本文介绍了Visual Studio包生成和私有bin路径中的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MEF来做一个粗略的插件架构。这工作很好但是,当我使用visual studio包/发布构建任务(我通过NAnt / MSbuild调用)进行部署时。我的未引用的插件程序集不包含在程序包中,因此未部署。



有没有办法告诉VS / MSBuild包含这些DLL?



他们住在/ bin /扩展。



干杯,
Rob

解决方案

在这篇博文中找到答案。它的工作原理: http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx



基本上这里是我添加到我的项目文件中的代码。

 <! -  
由RSL添加以处理部署插件文件夹
遵循这里的教程:
http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles .aspx
- >
< PropertyGroup>
< CopyAllFilesToSingleFolderForPackageDependsOn>
CollectExtensionDLLs;
CollectExtensionViews;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
< / CopyAllFilesToSingleFolderForPackageDependsOn>
< / PropertyGroup>
< Target Name =CollectExtensionDLLs>
< ItemGroup>
< _CustomFiles Include =bin \Extensions\ ** \ */>

< FilesForPackagingFromProject包含=%(_ CustomFiles.Identity)>
< DestinationRelativePath> bin\Extensions\%(RecursiveDir)%(Filename)%(Extension)< / DestinationRelativePath>
< / FilesForPackagingFromProject>
< / ItemGroup>
< / Target>
< Target Name =CollectExtensionViews>
< ItemGroup>
< _CustomFiles Include =Views\Extensions\ ** \ */>

< FilesForPackagingFromProject Include =%(_ CustomFiles.Identity)>
< DestinationRelativePath> Views\Extensions\%(RecursiveDir)%(Filename)%(Extension)< / DestinationRelativePath>
< / FilesForPackagingFromProject>
< / ItemGroup>
< / Target>
<! - //// End Rob的修改 - >


I am using MEF to do a sort of crude plugin architecture. This is working well. However, when I do a deployment using the visual studio package/publish build tasks (which I am calling via NAnt/MSbuild). My unreferenced plugin assemblies are not being included in the package and so are not deployed.

Is there a way to tell VS/MSBuild to include these DLLs?

They live in /bin/Extensions.

Cheers, Rob

解决方案

I have found the answer in this blog post. It works perfectly: http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx

Basically here's the code I added to my project file.

<!--
    Added by RSL to deal with deploying the plugins folder
    Followed tutorial here:
    http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx
  -->
    <PropertyGroup>
        <CopyAllFilesToSingleFolderForPackageDependsOn>
            CollectExtensionDLLs;
            CollectExtensionViews;
            $(CopyAllFilesToSingleFolderForPackageDependsOn);
        </CopyAllFilesToSingleFolderForPackageDependsOn>
    </PropertyGroup>
    <Target Name="CollectExtensionDLLs">
        <ItemGroup>
            <_CustomFiles Include="bin\Extensions\**\*"/>

            <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
                <DestinationRelativePath>bin\Extensions\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
            </FilesForPackagingFromProject>
        </ItemGroup>
    </Target>
    <Target Name="CollectExtensionViews">
        <ItemGroup>
            <_CustomFiles Include="Views\Extensions\**\*"/>

            <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
                <DestinationRelativePath>Views\Extensions\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
            </FilesForPackagingFromProject>
        </ItemGroup>
    </Target>
    <!-- //// End Rob's modifications -->

这篇关于Visual Studio包生成和私有bin路径中的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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