English 中文(简体)
How do I create an msdeploy manifest that includes destination properties like username and password?
原标题:

After a week of struggling I just got the msdeploy handler up on IIS7 (cursing the back-ass documentation thereof). So know I have a simple sync "working" but I d like to move as much of the -sync parameters in a manifest rather than burying it in my MSBUILD task. Here is the deploy command line:

msdeploy.exe -verb:sync 
    -source:package="D:ProjectsPackaged.zip"
    -dest:iisApp="beta.mysite.com",
        wmsvc=ops.mysite.com,
        username=deployUser,
        password=secret,
        skipAppCreation=true 
    -allowUntrusted=true

I have found alot of examples of manifests that contain the iisApp path, but they usually move the other bits to a parameters file for (i m guessing) user entry. Is there anything simple like this:

<!-- Pseudo-code manifest -->
<msdeploy.iisApp>
  <iisApp path="beta.mysite.com">
    <param key="wmsvc" value="ops.mysite.com"/>
    <param key="SkipAppCreation" value="true"/> 
    <param key="username" value="deployUser"/> 
    <param key="password" value="secret"/> 
  </iisApp> 
</msdeploy.iisApp>
最佳回答

Not exactly the same scenario but might give some idea.
This is what we did trying to update our database with msdeploy.
First we created a manifest.xml where we tell msdeploy dbFullSql provider where to look for our sql scripts:

<sitemanifest>
  <dbfullsql path="test1.sql"/>
  <dbfullsql path="test2.sql"/>
  <dbfullsql path="test3.sql"/>
</sitemanifest>  

Then you need parameter.xml where you specify database connection string:

<parameters>
  <parameter
     name="ConnectionString"
     value="Data Source=localhost;uid=user;password=pass;multipleactiveresultsets=false;Initial Catalog=Db_name">
  <parameterEntry type="ProviderPath" scope="dbFullSql"/>
 </parameter>

Now we are ready to create a package with our manifest:

msdeploy.exe -verb:sync -source:manifest="manifest.xml" -dest:package="package.zip"

And finally deploy it:

msdeploy.exe -verb:sync -source:package="package.zip" -dest:auto -setParamFile="parameter.xml"

So you can see how you can keep your parameters in a separate file. Magic!

问题回答

暂无回答




相关问题
Class-path in manifest not read when running jar in Unix

I have a client application that needs to run on Unix. It works fine in Windows but i get a NoClassDefFound exception in unix. Here s my manifest file: Manifest-Version: 1.0 Ant-Version: Apache Ant ...

How to add manifest to a .NET DLL?

I have a c# class library project that uses a COM dll registered on the system. I now want to deploy the COM dll as a side-by-side assembly, so I don t have to register it, or interfere with other ...

C# compiler options - embedding manifest file

I have found that it is possible to embedd manifest file (added to resources) with Compiler option /win32manifest. I am trying to find compiler options in VS express but I cannot see it. Could you ...

VSTO remove file without resigning the manifest

I have a file added to my vsto project and I want to remove this file after publishing the project. This is because the file should only be avaliable for some customers, for others we want to remove ...

热门标签