web deploy package not picking up parameters.xml when using latest csproj format
Asked Answered
B

1

2

I have a project which is being updated to use the new .csproj format. We used to use the following msbuild arguments:

msbuild Logging.sln /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="C:\Source\webdeploy"

Which created a .zip web deploy package. In the top level of this folder was parameters.xml, which is a copy of a custom parameters.xml from the project being built.

Since moving to the new .csproj format, the .zip is still being created, but the parameters.xml file inside the .zip is incorrect. I'm not sure where it comes from, but it just looks like a default file:

<parameters>
  <parameter name="IIS Web Application Name" value="Default Web Site" tags="IisApp">
    <parameterEntry kind="ProviderPath" scope="IisApp" match="^C:\\Source\\Repos\\Logging\\src\\Handler\\obj\\Debug\\net461\\win7-x86\\PubTmp\\Out\\$" />
  </parameter>
</parameters>

Is there a way to force msbuild to use the custom parameters.xml file?

EDIT: It looks as though there is a "declareParamFile" argument (https://technet.microsoft.com/en-us/library/dd569089(v=ws.10).aspx) you can pass into msdeploy - but not sure how to pass this through msbuild into msdeploy.

Burner answered 6/9, 2017 at 15:6 Comment(0)
C
1

Not sure why its not picking up you parameters.xml file, but you can pass a custom file with the ProjectParametersXMLFile property - /p:ProjectParametersXMLFile="c:\parameter.xml".

Corium answered 21/9, 2017 at 7:34 Comment(3)
Does this work with ASP.NET Core projects? I couldn't seem to get this to work with my project. I, like Tom, could get a web package, but not my parameters.xml embedded in the package.Unkindly
This does not work for ASP.NET Core projects. :( It does work with .NET Framework projects.Waites
I can confirm this fixes the same issue with "Web Site" projects that use a website.publishproj file. In our case, adding the following node to the <PropertyGroup> in our Release.pubxml file solved the problem: <ProjectParametersXMLFile>parameters.xml</ProjectParametersXMLFile>Aisne

© 2022 - 2024 — McMap. All rights reserved.