MSBuild目标和Visual Studio 2012问题

kip*_*oep 7 msbuild msbuild-task webdeploy msbuild-target visual-studio-2012

我很难通过Webdeploy使用Visual Studio 2012 UI部署我的第三方非参考程序集.我有一个名为'libraries'的文件夹,其中包含一些程序集.通过我的*.csproj文件中的以下内容,我可以将Build Action设置为' ThirdPartyAssemblies ':

<ItemGroup>
  <AvailableItemName Include="ThirdPartyAssemblies">
    <Visible>false</Visible>
  </AvailableItemName>
</ItemGroup>
<Target Name="AfterBuild">
  <Message Text="Build | Third party assemblies" Importance="high" />
  <Copy DestinationFolder="$(OutputPath)" SourceFiles="@(ThirdPartyAssemblies)" SkipUnchangedFiles="true" />
</Target>
Run Code Online (Sandbox Code Playgroud)

这很好用; 当我构建时,程序集被复制到bin文件夹的根目录:-)现在我遇到了一个问题:我无法通过Webdeploy将这些文件发布到服务器上.我尝试了很多东西,看起来我找不到适合这个任务的MSBuild目标...使用Visual Studio 2010我可以使用:

<Target Name="MyTargetName">
  <Message Text="Deploy | Third party assemblies" Importance="high" />
  <Copy DestinationFolder="$(OutputPath)" SourceFiles="@(ThirdPartyAssemblies)" SkipUnchangedFiles="true" />
</Target>
<PropertyGroup>
  <OnAfterCopyAllFilesToSingleFolderForPackage>
    MyTargetName
  </OnAfterCopyAllFilesToSingleFolderForPackage>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

问题是; 该OnAfterCopyAllFilesToSingleFolderForPackage目标不再被称为: - /

在深入研究之后C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets' file, I've also tried 'OnAfterCopyAllFilesToSingleFolderForMsdeploy,我却无法让它发挥作用.

任何人都可以告诉我我可以使用哪些目标将这些程序集复制到Package文件夹/带有Webdeploy的服务器?

为什么Visual Studio 2012没有将完整的bin文件夹复制到Package文件夹?

kip*_*oep 8

感谢Alexey,我找到了问题的解决方案,这就是我现在在.csproj文件中使用的,以支持复制Filesystem-和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>
Run Code Online (Sandbox Code Playgroud)