<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Batch file to precompile VS2005 web projects for deployment</title>
	<atom:link href="http://nomisit.wordpress.com/2008/03/03/batch-file-to-precompile-vs2005-web-projects-for-deployment/feed/" rel="self" type="application/rss+xml" />
	<link>http://nomisit.wordpress.com/2008/03/03/batch-file-to-precompile-vs2005-web-projects-for-deployment/</link>
	<description>My work with I.T, in particular SQL Server and .Net in business</description>
	<lastBuildDate>Fri, 11 Sep 2009 02:34:52 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: nomisit</title>
		<link>http://nomisit.wordpress.com/2008/03/03/batch-file-to-precompile-vs2005-web-projects-for-deployment/#comment-147</link>
		<dc:creator>nomisit</dc:creator>
		<pubDate>Tue, 26 Aug 2008 19:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://nomisit.wordpress.com/?p=11#comment-147</guid>
		<description>Hi ray,

I am presuming that your solutions and projects have been converted to VS2005?

What do you think is your problem when publishing, do you get an error message or does it appear to publish but give incorrect results? 

The method I outline in the above post addresses your particular problem to some degree in that, as an admin / solution deployer it dispenses with the need to use Visual Studio GUI at all for publishing web projects.

Place the above batch script in a new folder called “Build” at the same level as your 1.2.3.4 folder and also add a new folder called “Stage” at the same level as “Build” also.

So then from your example above you will have:-

___Stage
___Build
___1.2.3.4
______blah.sln

Within that solution, you ideally want folders for web projects existing at the same level on disk as the blah.sln, so on disk you *SHOULD* see the following:-

___Stage
___Build
___1.2.3.4
______blah.sln
______Services
______Web

I assume here that “Services” and “Web” are 2 independant web projects. That is not to say that each web project cannot contain sub folders of the site in the usual way because that is absolutely fine. The thing to get right here is the structure of the projects within the .sln file as shown above. This is possibly where your problems lay.

Then you would typically change directory to the “Build” folder and run the script from there.
To get the script to work change the “cd VSNet2005″ to “cd 1.2.3.4″ or use a batch file parameter to pass in the folder to prcompile. See above post for what happens next. You should end up with all precompiled content in the “Stage” folder like so:-

___Stage
______Services
______Web

You can then copy each of the project folders to your target location. There is one big drawback here though that you did not seem to mention. Copying the project folders to the target server(s) WILL NOT create web sites/virtual roots for you. I have written another tool for this same organisation that takes the output from the precompiled Stage folder and then using XML configuration files maintained by the team will deploy the precompiled web folders to the target server creating the virtual roots, application pools, etc along the way. Without the final part you will end up having to maintain the sites in IIS manually.

There are other methods of course. As an admin Microsoft suggest that you use their built in “Publish” option within the GUI to the target servers. If you persue this method, you want to ensure that you deploy a “Release” build. If you want the debug symbols then select these in the solution file options, I think it is the “pdb-only” option. Publishing directly will create the web sites/virtual roots that you require although I still think you will end up having to “fine tune” application pools, etc (which is why we elected to write tools to do it all across all .Net versions and VB6!).

You can use a Web Setup project of course for each site. The develpers usually prepare these as part of the development stage. Underneath Web Setup is MSI so you have an Uninstall option on the target server as well.

You could use the Web Copy tool in the Visual Studio GUI but this requires Front Page Server extensions on the target server and I doubt you will have that if your production environment is locked down as you say.

There is also a “deployer” utility offered by Microsoft and there are build tasks that can be added to solutions to address builds (and depoys).

Unless your final release scripts take care of the “deployment” steps involving configuring the web sites and virtual directories, setting up applications pools and accounts, etc you will still have to do this some other way.

Hope this helps you and good luck.

Si</description>
		<content:encoded><![CDATA[<p>Hi ray,</p>
<p>I am presuming that your solutions and projects have been converted to VS2005?</p>
<p>What do you think is your problem when publishing, do you get an error message or does it appear to publish but give incorrect results? </p>
<p>The method I outline in the above post addresses your particular problem to some degree in that, as an admin / solution deployer it dispenses with the need to use Visual Studio GUI at all for publishing web projects.</p>
<p>Place the above batch script in a new folder called “Build” at the same level as your 1.2.3.4 folder and also add a new folder called “Stage” at the same level as “Build” also.</p>
<p>So then from your example above you will have:-</p>
<p>___Stage<br />
___Build<br />
___1.2.3.4<br />
______blah.sln</p>
<p>Within that solution, you ideally want folders for web projects existing at the same level on disk as the blah.sln, so on disk you *SHOULD* see the following:-</p>
<p>___Stage<br />
___Build<br />
___1.2.3.4<br />
______blah.sln<br />
______Services<br />
______Web</p>
<p>I assume here that “Services” and “Web” are 2 independant web projects. That is not to say that each web project cannot contain sub folders of the site in the usual way because that is absolutely fine. The thing to get right here is the structure of the projects within the .sln file as shown above. This is possibly where your problems lay.</p>
<p>Then you would typically change directory to the “Build” folder and run the script from there.<br />
To get the script to work change the “cd VSNet2005″ to “cd 1.2.3.4″ or use a batch file parameter to pass in the folder to prcompile. See above post for what happens next. You should end up with all precompiled content in the “Stage” folder like so:-</p>
<p>___Stage<br />
______Services<br />
______Web</p>
<p>You can then copy each of the project folders to your target location. There is one big drawback here though that you did not seem to mention. Copying the project folders to the target server(s) WILL NOT create web sites/virtual roots for you. I have written another tool for this same organisation that takes the output from the precompiled Stage folder and then using XML configuration files maintained by the team will deploy the precompiled web folders to the target server creating the virtual roots, application pools, etc along the way. Without the final part you will end up having to maintain the sites in IIS manually.</p>
<p>There are other methods of course. As an admin Microsoft suggest that you use their built in “Publish” option within the GUI to the target servers. If you persue this method, you want to ensure that you deploy a “Release” build. If you want the debug symbols then select these in the solution file options, I think it is the “pdb-only” option. Publishing directly will create the web sites/virtual roots that you require although I still think you will end up having to “fine tune” application pools, etc (which is why we elected to write tools to do it all across all .Net versions and VB6!).</p>
<p>You can use a Web Setup project of course for each site. The develpers usually prepare these as part of the development stage. Underneath Web Setup is MSI so you have an Uninstall option on the target server as well.</p>
<p>You could use the Web Copy tool in the Visual Studio GUI but this requires Front Page Server extensions on the target server and I doubt you will have that if your production environment is locked down as you say.</p>
<p>There is also a “deployer” utility offered by Microsoft and there are build tasks that can be added to solutions to address builds (and depoys).</p>
<p>Unless your final release scripts take care of the “deployment” steps involving configuring the web sites and virtual directories, setting up applications pools and accounts, etc you will still have to do this some other way.</p>
<p>Hope this helps you and good luck.</p>
<p>Si</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray</title>
		<link>http://nomisit.wordpress.com/2008/03/03/batch-file-to-precompile-vs2005-web-projects-for-deployment/#comment-145</link>
		<dc:creator>Ray</dc:creator>
		<pubDate>Tue, 26 Aug 2008 13:09:42 +0000</pubDate>
		<guid isPermaLink="false">http://nomisit.wordpress.com/?p=11#comment-145</guid>
		<description>I&#039;m looking to try automating our deploys. I have just about everything except for making Visual studios publish the way the GUI does.

Basically my company has a lot of security measures in place and a lot of the developers do not have access to production environments. This leaves a lot of the code deploys to the administrators (ie me). I&#039;m not familiar with Visual Studios 2005, at all. The steps of our deployment are as follows:

Download the script from our version control software (Vault) to a folder called 1.2.3.4. 
Open folder 1.2.3.4 and open the 1.2.3.4\blah.sln

In VisualStudios make sure the configuration is set to Debug - right click the top Main Solution and click Clean Solution.

Go down to the Project (called web) right click and hit Publish.

It prompts me saying &#039;Where do you want to publish &quot;Services&quot; which is another Project (Directly above Web) and I give it a folder to publish to, then it asks me where to publish &#039;Web&#039; which is the project I originally selected on.

It then publishes the files to the selected local folders that I can use my batch scripts to copy to the proper servers.

I&#039;m having problems with the publishing of the Projects to the folders so that I can have my batch script copy to the remote locations.

Any ideas?</description>
		<content:encoded><![CDATA[<p>I&#8217;m looking to try automating our deploys. I have just about everything except for making Visual studios publish the way the GUI does.</p>
<p>Basically my company has a lot of security measures in place and a lot of the developers do not have access to production environments. This leaves a lot of the code deploys to the administrators (ie me). I&#8217;m not familiar with Visual Studios 2005, at all. The steps of our deployment are as follows:</p>
<p>Download the script from our version control software (Vault) to a folder called 1.2.3.4.<br />
Open folder 1.2.3.4 and open the 1.2.3.4\blah.sln</p>
<p>In VisualStudios make sure the configuration is set to Debug &#8211; right click the top Main Solution and click Clean Solution.</p>
<p>Go down to the Project (called web) right click and hit Publish.</p>
<p>It prompts me saying &#8216;Where do you want to publish &#8220;Services&#8221; which is another Project (Directly above Web) and I give it a folder to publish to, then it asks me where to publish &#8216;Web&#8217; which is the project I originally selected on.</p>
<p>It then publishes the files to the selected local folders that I can use my batch scripts to copy to the proper servers.</p>
<p>I&#8217;m having problems with the publishing of the Projects to the folders so that I can have my batch script copy to the remote locations.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
