2016-02-17 45 views
0

我想一些額外的文件從一個模塊到IIS server.I've複製讀取和重新閱讀this post了大量的時間沒有複製文件。無法爲試圖遵循SS,但我的答案將文件添加到發佈配置

這裏是我的pubxml

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
<PropertyGroup> 
<WebPublishMethod>MSDeploy</WebPublishMethod> 
<LastUsedBuildConfiguration>XXX</LastUsedBuildConfiguration> 
<LastUsedPlatform>Any CPU</LastUsedPlatform> 
<SiteUrlToLaunchAfterPublish /> 
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> 
<ExcludeApp_Data>True</ExcludeApp_Data> 
<MSDeployServiceURL>http://XXX</MSDeployServiceURL> 
<DeployIisAppPath>XXX</DeployIisAppPath> 
<RemoteSitePhysicalPath /> 
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer> 
<MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod> 
<EnableMSDeployBackup>True</EnableMSDeployBackup> 
<UserName>ifinformatica\administrator</UserName> 
<_SavePWD>True</_SavePWD> 
<PublishDatabaseSettings> 
    <Objects xmlns=""> 
    <ObjectGroup Name="default" Order="1" Enabled="False"> 
     <Destination Path="" /> 
     <Object Type="DbDacFx"> 
     <PreSource Path="Data Source=XXX ;Initial Catalog=XXX ;User ID=XXX ;Password=XXX ;Application Name=XXX includeData="False" /> 
     <Source Path="$(IntermediateOutputPath)AutoScripts\default_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" /> 
     </Object> 
     <UpdateFrom Type="Web.Config"> 
     <Source MatchValue="Data Source=XXX;Initial Catalog=XXX;User ID=XXX;Password=XXX;Application Name=XXX" MatchAttributes="$(UpdateFromConnectionStringAttributes)" /> 
     </UpdateFrom> 
    </ObjectGroup> 
    </Objects> 
</PublishDatabaseSettings> 
<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect> 

< _CustomFiles包括= 「.. \模塊***」/> %(RecursiveDir)%(文件名)%(分機) CustomCollectFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn);

<CopyAllFilesToSingleFolderForMsdeployDependsOn> 
    CustomCollectFiles; 
    $(CopyAllFilesToSingleFolderForPackageDependsOn); 
</CopyAllFilesToSingleFolderForMsdeployDependsOn> 

我使用VS2015,我的模塊文件夾,正確的是(.. \模塊)

enter image description here

你看到任何特定相關的錯誤?

回答

0

除非我誤解了這個問題,否則您需要將Copy to Output Directory屬性設置爲Always

enter image description here

爲了將它們添加到在VS2010的CopyAllFilesToSingleFolderForPackageDependsOn屬性添加不屬於你的項目,你可以extend WebDeploy to include additional files via MSBuild的一部分文件。 this property name changed for VS2012CopyAllFilesToSingleFolderForMsdeployDependsOn

+0

這將不會在我的情況下工作,因爲該文件放在modules文件夾,因爲模塊文件夾在生成時填充模塊項目我建立然後我複製.dll&.pdb文件與後製作動作 – advapi

+1

這使得更有意義。添加了另一個選項,我的答案應該有所幫助。 – chief7

相關問題