Is there a way to set MSDeploy parameters in .csproj file itself of ASP.NET MVC project? Particularly a "skip" parameter, which should skip a "Temp" folder.
-skip:objectName=dirPath,absolutePath="\\temp"
.. or how can I pass this parameter into MSBuild.exe arguments list?
How to open a CSPROJ file. CSPROJ files are are meant to be opened and edited in Microsoft Visual Studio (Windows, Mac) as part of Visual Studio projects. However, because CSPROJ files are XML files, you can open and edit them in any text or source code editor.
csproj file tells dotnet how to build the ASP.NET application. It's one of the most important files in an ASP.NET project. An ASP.NET project can depend on third-party libraries developed by other developers.
In addition to the generic Item element, ItemGroup allows child elements that represent types of items, such as Reference , ProjectReference , Compile , and others as listed at Common MSBuild project items.
Define <MsDeploySkipRules>
in the project file. For example:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OnBeforePackageUsingManifest>AddSkipRules</OnBeforePackageUsingManifest>
</PropertyGroup>
<Target Name="AddSkipRules">
<ItemGroup>
<MsDeploySkipRules Include="SkipTempDirOnDeploy">
<SkipAction></SkipAction>
<ObjectName>dirPath</ObjectName>
<AbsolutePath>$(_Escaped_PackageTempDir)\\Temp$</AbsolutePath>
<XPath></XPath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
</Project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With