Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 创建服务器级Web部署包_Asp.net_Iis_Webdeploy - Fatal编程技术网

Asp.net 创建服务器级Web部署包

Asp.net 创建服务器级Web部署包,asp.net,iis,webdeploy,Asp.net,Iis,Webdeploy,在IIS服务器管理员为我手动创建站点后,我可以使用Web Deploy创建可以导入到现有IIS站点中的包 我可以使用Web Deploy创建可以作为站点而不是应用程序导入的包吗 当我试图导入我现有的包时,我得到了这个丑陋的错误 这可能不是问题的答案,因为我们无法找到有关如何创建网站包的信息 但正如您在评论中所要求的,下面是我关于如何使用包进程创建的.cmd文件在站点级安装的方法 第一步 我使用msbuild在构建过程中创建了一个包。我刚刚在我们的正常构建中添加了一个额外的步骤,在部署目录中创建项

在IIS服务器管理员为我手动创建站点后,我可以使用Web Deploy创建可以导入到现有IIS站点中的包

我可以使用Web Deploy创建可以作为站点而不是应用程序导入的包吗

当我试图导入我现有的包时,我得到了这个丑陋的错误


这可能不是问题的答案,因为我们无法找到有关如何创建网站包的信息

但正如您在评论中所要求的,下面是我关于如何使用包进程创建的.cmd文件在站点级安装的方法

第一步 我使用msbuild在构建过程中创建了一个包。我刚刚在我们的正常构建中添加了一个额外的步骤,在部署目录中创建项目文件

<Target Name="CreateDeploymentPackage">
    <MSBuild Projects="$(CurrentProject).csproj" Targets="Package"
      properties="Platform=$(Platform);
      Configuration=$(Configuration);
      DeployOnBuild=false;
      DeployTarget=Package;
      PublishProfile=$(Environment);
      PackageLocation=$(DeployDirectory)\_PublishedWebsites\DeployPackage\$(CurrentProject).zip;
      PackageAsSingleFile=true;
      _PackageTempDir=$(PackageOutputDir)\temp;">
    </MSBuild>
</Target>

还有很多改进的余地,我想自动化更多,但这就是我现在拥有的。

基本上不是在站点的根目录下安装,而是部署到站点内的文件夹

我想问同样的问题。只有在使用提供的命令行.cmd并使用适当的数据编辑SetParameters.xml时,我才能在服务器级别导入我发现您可以使用PowerShell DSC部署站点。它与Web部署没有任何关系,但它看起来更灵活。而且看起来很不错。我确实坚持使用Web Deploy并使用parameters.xml来配置和执行
Web.Deploy.cmd/Y-setParamFile:“Web.SetParameters-.xml”
我很想看看您如何设置构建配置/Web config transformations/parameters.xml files@spankmaster79这与我现在的配置非常相似。我不喜欢为每个环境设置Web.$(Configuration).config文件,但我也不想将特定于环境的常量移动到parameters.xml文件中。我希望有更好的方法。我也希望有,仍然在搜索,希望我确实错过了一些东西,可能使用*.wpp.targets文件来驱动XDT转换,而不是$(配置)变量?因此,您将始终构建和部署
Release
配置,可以选择应用
Web.Release.config
,然后最终让*.wpp.targets中的自定义部署步骤应用特定于环境的转换。那么,我将如何为不同的环境创建不同的*.wpp.targets文件?我使用.wpp.targets文件为某些文件夹和文件的删除操作应用自定义跳过规则。您将拥有一个wpp.targets文件。在该文件中,您将有一个自定义构建步骤,该步骤应用来自
Web.$(Environment.config
的XDT转换。这将在应用
Web.$(配置).config
后发生。最后,您将指定
/p:Environment=STAGING
作为MSBuild参数。
<?xml version="1.0" encoding="utf-8" ?> 
<parameters>
  <parameter name="Log4net to email"
   description="Please provide the email address for Log4net."
   defaultValue="itsupport@ourcompany.com"
   tags="">
    <parameterEntry kind="XmlFile" scope="\\web.config$" match="//log4net/appender[@name='SmtpAppender']/to/@value" />
  </parameter>

  <parameter name="Webservice address"  
    description="Please provide the endpoint address for the document web service" 
    defaultValue="http://test.services.ourcompany.com/Service.svc"
    tags="">
    <parameterEntry kind="XmlFile" scope="\\web.config$" match="//system.serviceModel/client/endpoint/@address" />
  </parameter>

  <parameter name="Elmah error email subject"
    description="Please provide the elmah errormail subject"
    defaultValue="Our Portal (Production) | An unexpected error occurred"
    tags=""> 
    <parameterEntry kind="XmlFile" scope="\\web.config$" match="//elmah/errorMail/@subject" />
  </parameter>
</parameters>
<?xml version="1.0" encoding="utf-8"?>
<parameters>
  <setParameter name="IIS Web Application Name" value="staging-sitename.ourcompany.com" />
  <setParameter name="Log4net to email" value="webdev@ourcompany.com" />
  <setParameter name="Webservice address" value="http://staging.services.ourcompany.com/Service.svc" />
  <setParameter name="Elmah error email subject" value="Our Portal (Staging) |  An unexpected error occurred" />
  <setParameter name="PortalEntities-Web.config Connection String" value="metadata=res://*/Src.Entity.PortalEntities.csdl|res://*/Src.Entity.PortalEntities.ssdl|res://*/Src.Entity.PortalEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=test.sql.ourcompany.com;Initial Catalog=Portal_Staging;User Id=<userid>;Password=<password>;Application Name ='OurPortal';Connection Timeout=180;MultipleActiveResultSets=True&quot;" />
</parameters>
Portal.Web.deploy.cmd /Y -setParamFile:"Portal.Web.SetParameters-STAGING.xml"