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.
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"
.
来源:https://stackoverflow.com/questions/46078706/web-deploy-package-not-picking-up-parameters-xml-when-using-latest-csproj-format