• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 988
  • Last Modified:

Encrypt Web.Config

Hi,

What I want to do is use the Pre or Post Build Command line (not sure which) in my web application build properties screen to pass the aspnet_regiis comand which i would like to encrypt a section of my web.config file upon building it.

Can any one give me a bit of advice and direction on how to do this.

Thanks in advance

Andrew
0
REA_ANDREW
Asked:
REA_ANDREW
  • 5
  • 4
1 Solution
 
Bob LearnedCommented:
Is this a 'Web Setup Project'?  Do you have syntax for aspnet_regiis?

Bob
0
 
REA_ANDREWAuthor Commented:
Hi Bob,

Yes this is using the Web Application Add In for VS. The syntax I have is found here

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

I am using the  -pef section webApplicationDirectory syntax

hen I build my project the Command exits with code 9009

Cheers

Andrew
0
 
Bob LearnedCommented:
Andrew,

1) Can you show me the complete syntax for the command?

2) Are you getting an error like this?

Performing Post-Build Event...
'regasm' is not recognized as an internal or external command,
operable program or batch file. Project error: A tool returned an error code from the build event
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(814,9): error MSB3073: The command "RegAsm.exe "[Path]\MyClassLib.dll"" exited with code 9009.

Post-Build Event failed

http://support.microsoft.com/kb/908268

Bob
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
REA_ANDREWAuthor Commented:
Bob,

This is where I have seen an example of what I need to do, only instead of using the command line to do this I wish to put the instruction inside the command line list in VS pre or psot Build not sure which

http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx

Cheers

Andrew
0
 
Bob LearnedCommented:
This should be a valid post-build event.  What did you try?

Bob
0
 
REA_ANDREWAuthor Commented:
I simply copied it into the post build command line box but using my section as opposed to the one in the example

aspnet_regiis -pef connectionStrings

Andrew
0
 
REA_ANDREWAuthor Commented:
Found it I need to use the full path of the exe rather than just the name

Andrew
0
 
Bob LearnedCommented:
That was where I was headed, but you beat me to it.  I wasn't sure if you were using the full path.

Bob
0
 
REA_ANDREWAuthor Commented:
Cheers for help though Bob, Appreciate It

Andrew

:-)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now