Batch Deployment

C

Chuck P

I was wondering what practices people have come up with for
deployment. I want to precompile the application and encrypt portions
of the web.config.

In 1.0 I just did a batch file that would
copy %source%\*.aspx %web%\*.*
copy %source%\bin\*.dll %web%\bin\*.*
rem copy %source%\web.config %web%\*.*

Would rem out web.config because of changes in web.config. Such as
pointing to the production servers versus the development ones and
encrypting of the connections strings using the DPAPI and the machine
key.

In 2.0 was thinking of doing the same with a batch file

aspnet_compiler -v /<websitename> -p <source> <destination>
aspnet_regiis.exe -pef "connectionStrings" %website% –prov
"DataProtectionConfigurationProvider"

An issue I was having is where to automatically find the latest and
greatest version of the compiler. I know they are stored at:
%WinDir%\Microsoft.NET\Framework\<versionNumber>
How can I automatically get the location of the most recent one to run
in my .bat file.

Or is there an easier more reliable way to precompile the app and
encrypt the web.config.


thanks,
 
S

Steven Cheng[MSFT]

Hi Chuck,

Welcome to the ASP.NET newsgroup.

As for the .net framework, the runtime and framework library is always
installed under the

%WinDir%\Microsoft.NET\Framework\<versionNumber>

also each released framework will have fixed version number. For .net 2.0,
it's v2.0.50727. So you can just reference the target framework's dir
through the above path (with correct version number). And when you use the
asp.net_compiler tool to compile website application, make sure the
compiler's framework version is identical to the target IIS application
virtual directory's ASP.NET version.

Also, as for publishing and deploying ASP.NET 2.0 web application, the
ASP.NET dev team has provided a new project for deploying asp.net 2.0 web
application, it has supplied us web.config file section replacing funciton,
we can use this to replace some certain cofiguration sections in the
web.config during publish/deploy time. Also, this deployment project can be
automated through MSBUILD tool in command line(through the XML based
project file):

#Visual Studio 2005 Web Deployment Projects (Beta V2 Preview)
http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/

And here are some web articles about configuration encrypting in ASP.NET
2.0:

#How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI
http://msdn.microsoft.com/library/en-us/dnpag2/html/paght000005.asp?frame=tr
ue

#Encrypting Configuration Information in ASP.NET 2.0 Applications
http://aspnet.4guysfromrolla.com/articles/021506-1.aspx

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
C

Chuck P

Thanks Steven,

The build stuff was interesting, I'd like to keep it simple with a no
learning curve method, AKA a batch file.

I understand the net framework has been historically installed at
%WinDir%\Microsoft.NET\Framework\<versionNumber>. Is there a
progamatic way to determine where the most current version of the
netframe work is installed. I know VS figures it out somehow. Perhaps
there is a registry entry with the current version. Or a registry
entry with an enumeration?

thanks,
 
C

Chuck P

I found and enviromnet variable that has a cool batch file at the
location

call "%VS80COMNTOOLS%vsvars32.bat"

this tells me where everything is and the version!
 
S

Steven Cheng[MSFT]

Thanks for your response Chunk,

Glad that you've found the tool. Also, this tool is contained in the
VS80(2005) common tools. BTW, we can also find the installed .net framework
version info under the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy

If there is anything else we can help, please feel free to post here.

Good luck!

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Joined
Aug 26, 2008
Messages
1
Reaction score
0
Hello,

I'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'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 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/Release depending on where its being deployed to - 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 'Where do you want to publish "Services" (which is another Project directly above Web) and I give it a folder to publish to, then it asks me where to publish 'Web' 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'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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top