Open unkinected opened 6 years ago
The fix should happen here - https://github.com/aspnet/websdk/blob/4242b7c808ab0b87cb4e48ca79a44001e4e0f276/src/Publish/Microsoft.NET.Sdk.Publish.Targets/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeployPackage.targets#L193
This should honor the MsDeploySkipRules https://github.com/aspnet/websdk/blob/4242b7c808ab0b87cb4e48ca79a44001e4e0f276/src/Publish/Microsoft.NET.Sdk.Publish.Targets/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeployPackage.targets#L286
this keeps biting me. is this something that is still on the radar to be fixed?
This is something that we would really like too. This works perfectly in classic ASP.NET, but not for .NET Core. We'd rather not have to amend the .cmd file every time
Any udates on this, Im still facing this issue. skip rules mentioned in .pubxml are not getting added to .deploy.cmd
Repro steps:
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>7c382f5c-a447-4b79-96f4-174017110b71</ProjectGuid>
<DesktopBuildPackageLocation>PublishOutput\WebApplication1.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/WebApp</DeployIisAppPath>
</PropertyGroup>
<ItemGroup>
<MsDeploySkipRules Include="CustomSkipFolder">
<ObjectName>filePath</ObjectName>
<AbsolutePath>appsettings.json</AbsolutePath>
</MsDeploySkipRules>
</ItemGroup>
</Project>
dotnet msbuild "WebApplication1.csproj" /nr:false /m /p:DeployOnBuild=true;PublishProfile=IISProfile
This has still not been fixed, as can be seen here:
The MSDeploy target correctly passes the SkipRuleItems
parameter to the MSDeploy/VSMSDeploy task, but the MSDeployPackage target does not.
@vijayrkn was there a clear rationale behind changing this behavior from the old ASP.Net behavior? If so, please enlighten me :wink:
Is there some workaround other than manually editing the Microsoft.NET.Sdk.Publish.MSDeployPackage.targets
file?
As things stand, this is a big pain :disappointed:
After 2 very frustrating days trying to get this to work I too can confirm this is still an issue with Web Deploy Package format. Editing the Microsoft.NET.Sdk.Publish.MSDeployPackage.targets does not work either, the resulting .cmd file will still not load the -skip rules. This should just work and is really a major downfall for this product.
Am I missing a step in editing the .targets file?
Per the latest (as of 12/20/2017) comments on this issue: https://github.com/aspnet/websdk/issues/239, msdeploy skip rules are not being honored during web package creation and deployment. The cmd file that is generated for the package does not include any skip rules specified per the documentation.
Can we please add support for this? This would make my life a whole simpler if I don't have to edit the cmd file myself manually after the package is created.
Thanks!