2016-05-05 17 views
0

Ich verwende die post here, um MVC5-Anwendung auf IIS 8 bereitzustellen. In IIS habe ich eine Website "Standardwebsite", die auf physischen Speicherort "C: \ Inetpub \ wwwroot \ mywebsite" Meine Builddatei wie folgt angezeigt wirdMS Web Deploy Erstellen eines neuen Ordners unter der Website?

<?xml version="1.0" encoding="utf-8"?> 
     <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0"> 
      <PropertyGroup> 
      <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> 
      <ProjectFile Condition=" '$(ProjectFile)' == '' ">.\UI\$(ProjectName)\$(ProjectName).csproj</ProjectFile> 
      <DeployServiceUrl Condition=" '$(DeployServiceUrl)' == '' ">http://localhost</DeployServiceUrl> 
      </PropertyGroup> 

      <Target Name="VerifyProperties"> 
      <!-- Verify that we have values for all required properties --> 
      <Error Condition=" '$(ProjectName)' == '' " Text="ProjectName is required." /> 
      </Target> 

      <Target Name="Build" DependsOnTargets="VerifyProperties"> 
      <!-- Deploy using windows authentication --> 
      <MSBuild Projects="$(ProjectFile)" 
        Properties="Configuration=$(Configuration); 
            MvcBuildViews=False; 
            DeployOnBuild=true; 
            DeployTarget=MSDeployPublish; 
            CreatePackageOnPublish=True; 
            AllowUntrustedCertificate=True; 
            MSDeployPublishMethod=RemoteAgent; 
            MsDeployServiceUrl=$(DeployServiceUrl); 
            SkipExtraFilesOnServer=True; 
            UserName=; 
            Password=;" 
        ContinueOnError="false" /> 
      </Target> 
     </Project> 

ich bin mit dem folgenden Befehl &

msbuild build.xml /p:Configuration=Release;ProjectName=MyProjectName;DeployServiceUrl=http://localhost 

Der Befehl baut das Projekt bereitstellen zu bauen und setzt das Projekt. Das Projekt wird jedoch nicht direkt unter "Standardwebsite" bereitgestellt, sondern durch das Erstellen einer neuen Anwendung unter "Standardwebsite" mit dem Namen "MyProjectName_deploy", und diese Anwendung verweist auf einen neuen physischen Speicherort. "C: \ inetpub \ wwwroot \ mywebsite \ MyProjectName_deploy"

ich den Code wollen direkt an C zu implementieren: \ inetpub \ wwwroot \ mywebsite wo "Default Web Site" zeigt.

Antwort