Install ASP.NET version via MSBUILD

I am trying to create a new website on a remote server via msbuild (I like to call it msdeploy). I've downloaded and used SDC Tasks, MSBuildExtension Tasks, and MSBuildCommunity Tasks, but I just can't figure it out.

I suppose it is WebDirectorySetting (from MSBuild.Community.Tasks.IIS) that is my best bet, but I can't seem to find the filename I want.

I would like to use some kind of MSBuild task to do this, but maybe it just doesn't exist. Custom VBS or WMI is my last resort ...

thank

+1


source to share


5 answers


thank you for your responses. I've played around with both of these suggestions, but neither is "exactly" what I was looking for, even if it gets the job done. I can't see we ever go back to 1.1, so we ended up making it the default, but I still hope there is a magic setting for some task that can do it.



thanks again

+1


source


in IIS7, you can do it with the MSBuild extension:



<MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Create"
              Name="$(AppPool)"
              IdentityType="SpecificUser"                  
              PipelineMode="Integrated"
              ManagedRuntimeVersion="v4.0"
              PoolIdentity="$(UserName)"
              IdentityPassword="$(UserPassword)"

      

+2


source


I tried to do the same for a while, but eventually realized that we are mainly using version 2.0 for everything, so I did this by default with aspnet_regiis on the machines I deploy.

If you can run a shell command on the remote server, you can use aspnet_regiis.exe with -sn to register a specific version of asp.net for the application.

http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx

+1


source


Run the aspnet_regiis tool from your msbuild task with the Exec tag. It's not as "clean", but it works.

+1


source


None of this works just like the following lines:

First, create a website directory:

<WebDirectoryCreate
    ServerName="$(DeployServerName)"        
    VirtualDirectoryName="MyVirualSiteName" />

      

Second, apply the correct ASP.NET version:

<InstallAspNet 
    Path="W3SVC/1/Root/MyVirualSiteName" 
    Version="Version20" />

      

Have the best

0


source







All Articles