2016-09-19 3 views
0

Ich muss Ordner Medien, Umbraco und Umbraco_client von der Veröffentlichung des Projekts ausschließen. Diese Ordner werden selten geändert und ich möchte nicht jedes Mal warten, bis sie während der Veröffentlichung auf dem FTP-Server kopiert werden. Hier ist meine Config local.pubxml:ohne Ordner aus Visual Studio 2015 Veröffentlichung

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <WebPublishMethod>FileSystem</WebPublishMethod> 
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> 
    <LastUsedPlatform>Any CPU</LastUsedPlatform> 
    <SiteUrlToLaunchAfterPublish /> 
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> 
    <ExcludeApp_Data>False</ExcludeApp_Data> 
    <publishUrl>My_path</publishUrl> 
    <DeleteExistingFiles>False</DeleteExistingFiles> 
    <ExcludeFoldersFromDeployment>media;umbraco;umbraco_client</ExcludeFoldersFromDeployment> 
    <MSDeployUseChecksum>true</MSDeployUseChecksum> 
    <AfterAddIisSettingAndFileContentsToSourceManifest>AddCustomSkipRules</AfterAddIisSettingAndFileContentsToSourceManifest> 
    </PropertyGroup> 
    <Target Name="AddCustomSkipRules"> 
    <Message Text="Adding Custom Skip Rules" /> 
    <ItemGroup> 
     <MsDeploySkipRules Include="SkipmediaFolder"> 
     <ObjectName>dirPath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\media</AbsolutePath> 
     <XPath> 
     </XPath> 
     </MsDeploySkipRules> 
     <MsDeploySkipRules Include="SkipUmbracoFolder"> 
     <ObjectName>dirPath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\umbraco</AbsolutePath> 
     <XPath> 
     </XPath> 
     </MsDeploySkipRules> 
     <MsDeploySkipRules Include="SkipUmbraco_clientConfig"> 
     <ObjectName>dirPath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\umbraco_client</AbsolutePath> 
     <XPath> 
     </XPath> 
     </MsDeploySkipRules> 
    </ItemGroup> 
    </Target> 
</Project> 

Danach Medienordner nicht veröffentlicht, aber umbraco und umbraco_client Ordner noch weiter in dem Prozess der Veröffentlichung kopieren. Danach habe ich Umbraco und Umbraco_client Ordner aus dem Projekt ausgeschlossen, aber es löst auch nicht das Problem. Irgendwelche Ideen? :)

+0

Diese Methode funktioniert immer für mich. Vielleicht ist etwas schiefgelaufen, als du es anfingst. Können Sie das aktuelle Profil nicht löschen und erneut starten? VS ist manchmal temperamentvoll. –

Antwort

1

ich diese Arbeit nach einigen Problemen machen, vielleicht hilft es Ihren Fall:

1.- Ihre MsDeploySkipRules in einer separaten Datei mit dem Namen yourprojectname.wpp.targets im selben Ordner wie CSPROJ bewegen, mit der folgenden Inhalt (Sie müssen eine filePath und dirpath für jeden Ordner mit seinen Platzhalter) setzen:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <ItemGroup> 

     <MsDeploySkipRules Include="SkipmediaFolderFiles"> 
     <SkipAction></SkipAction> 
     <ObjectName>filePath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\media\\.*</AbsolutePath> 
      <Apply>Destination</Apply> 
     <XPath></XPath> 
     </MsDeploySkipRules> 
     <MsDeploySkipRules Include="SkipmediaFolderChildFolders"> 
     <SkipAction></SkipAction> 
     <ObjectName>dirPath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\media\\.*\\*</AbsolutePath> 
      <Apply>Destination</Apply> 
     <XPath></XPath> 
     </MsDeploySkipRules> 

     <MsDeploySkipRules Include="SkipUmbracoFolderFiles"> 
      <SkipAction></SkipAction> 
     <ObjectName>filePath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\umbraco\\.*</AbsolutePath> 
      <Apply>Destination</Apply> 
     <XPath></XPath> 
     </MsDeploySkipRules> 
     <MsDeploySkipRules Include="SkipUmbracoFolderChildFolders"> 
      <SkipAction></SkipAction> 
     <ObjectName>dirPath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\umbraco\\.*\\*</AbsolutePath> 
      <Apply>Destination</Apply> 
     <XPath></XPath> 
     </MsDeploySkipRules> 

     <MsDeploySkipRules Include="SkipUmbraco_clientFolderFiles"> 
      <SkipAction></SkipAction> 
     <ObjectName>filePath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\umbraco_client\\.*</AbsolutePath> 
      <Apply>Destination</Apply> 
     <XPath></XPath> 
     </MsDeploySkipRules> 
     <MsDeploySkipRules Include="SkipUmbraco_clientFolderChildFolders"> 
      <SkipAction></SkipAction> 
     <ObjectName>dirPath</ObjectName> 
     <AbsolutePath>$(_DestinationContentPath)\\umbraco_client\\.*\\*</AbsolutePath> 
      <Apply>Destination</Apply> 
     <XPath></XPath> 
     </MsDeploySkipRules> 

     </ItemGroup> 

</Project> 

2.- nach dieser (SEHR WICHTIG), um die Datei speichern, schließen Sie Visual Studio und öffnen Sie sie erneut. Viele Leute scheitern an dieser Stelle (sie modifizieren die Datei und versuchen, sie erneut zu verteilen, ohne VS zu schließen, und dann wissen sie keine Änderung zu schätzen und glauben fälschlicherweise, dass das nicht funktioniert).

3.- Versuchen Sie erneut zu veröffentlichen.

Getestet in Visual Studio 2015.