在Visual Studio 2012中使用_bin_deployableAssemblies [英] Using _bin_deployableAssemblies with Visual Studio 2012

查看:104
本文介绍了在Visual Studio 2012中使用_bin_deployableAssemblies的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2010中,我使用_bin_deployableAssemblies文件夹来包含第三方程序集,这些程序集应在构建和Web部署时包含在bin文件夹中. 它与网站所需的那些第三方程序集有关,但是您不想引用它们. 这很棒...

With Visual Studio 2010 I used the _bin_deployableAssemblies folder to include third party assemblies which should be included in the bin folder on build and web deploy. It's about those third party assemblies which are needed for the website, but you don't want to reference them. This worked awesome...

现在,在Visual Studio 2012中,它停止工作了……好吧,它的一部分停止了工作. 在构建时,_bin_deployableAssemblies文件夹的内容将复制到bin文件夹. 但是,当我执行webdeploy(例如到本地磁盘)时,这些文件不会发布到输出文件夹的bin文件夹中.

Now with Visual Studio 2012 it stopped working... Well, a part of it stopped working. When I build, the contents of the _bin_deployableAssemblies folder are copied to the bin folder. But when I execute webdeploy, for instance to my local disk, those files are not published to the output folder's bin folder.

我正在.csproj文件中使用它:

I'm using this in my .csproj file:

<PropertyGroup>
  <OnAfterCopyAllFilesToSingleFolderForPackage>
    __MoveFilesFromUmbracoSubdirsToBinPackageTemp
  </OnAfterCopyAllFilesToSingleFolderForPackage>
</PropertyGroup>
<Target Name="_CopyBinDeployableAssemblies" Condition="Exists('$(MSBuildProjectDirectory)\_bin_deployableAssemblies')">
  <CreateItem Include="$(MSBuildProjectDirectory)\_bin_deployableAssemblies\**\*.*" Condition="Exists('$(MSBuildProjectDirectory)\_bin_deployableAssemblies')" Exclude="$(MSBuildProjectDirectory)\_bin_deployableAssemblies\**\.svn\**\*">
    <Output ItemName="_binDeployableAssemblies" TaskParameter="Include" />
  </CreateItem>
  <Copy SourceFiles="@(_binDeployableAssemblies)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" />
</Target>
<Target Name="__MoveFilesFromUmbracoSubdirsToBinPackageTemp">
  <Message Text="Moving files from bin\umbraco\ and bin\umbraco plugins\ to bin\" Importance="high" />
  <CreateItem Include="$(_PackageTempDir)\bin\umbraco\*.*;$(_PackageTempDir)\bin\umbraco plugins\*.*">
    <Output ItemName="_umbracoItems" TaskParameter="Include" />
  </CreateItem>
  <Move SourceFiles="@(_umbracoItems)" DestinationFolder="$(_PackageTempDir)\bin" />
  <Message Text="Removing bin\umbraco\ and bin\umbraco plugins\ folders" Importance="high" />
  <RemoveDir Directories="$(_PackageTempDir)\bin\umbraco;$(_PackageTempDir)\bin\umbraco plugins" />
</Target>

有人可以帮助我如何在ouput文件夹的bin文件夹中获取这些程序集吗?

Could anyone help me out how I get those assemblies in the ouput folder's bin folder?

推荐答案

感谢Alexey,我找到了解决问题的方法,这就是我现在在.csproj文件中使用的功能,用于支持复制Filesystem-的第三方程序集.和Webdeploy:

Thanks to Alexey I found the solution to my problem, this is what I'm using now in my .csproj file to support copying third party assemblies for Filesystem- and Webdeploy:

<ItemGroup>
    <AvailableItemName Include="ThirdPartyAssemblies">
        <Visible>false</Visible>
    </AvailableItemName>
</ItemGroup>
<Target Name="AfterBuild">
    <Message Text="Build | Copying third party assemblies to output folder ($(OutputPath))" Importance="high" />
    <Copy DestinationFolder="$(OutputPath)" SourceFiles="@(ThirdPartyAssemblies)" SkipUnchangedFiles="true" />
</Target>
<Target Name="CopyBinFiles" AfterTargets="CopyAllFilesToSingleFolderForPackage" BeforeTargets="MSDeployPublish">
    <Message Text="Deploy | Copying third party assemblies to output folder ($(_PackageTempDir)\bin\)" Importance="high" />
    <Copy DestinationFolder="$(_PackageTempDir)\bin\" SourceFiles="@(ThirdPartyAssemblies)" SkipUnchangedFiles="true" />
</Target>

来自: MSBuild目标和Visual Studio 2012问题

这篇关于在Visual Studio 2012中使用_bin_deployableAssemblies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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