We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Encrypt Web.Config

REA_ANDREW
REA_ANDREW asked
on
Medium Priority
1,002 Views
Last Modified: 2008-03-03
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
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
Is this a 'Web Setup Project'?  Do you have syntax for aspnet_regiis?

Bob

Author

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
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
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

Author

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
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
This should be a valid post-build event.  What did you try?

Bob

Author

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

Author

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

Andrew
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008
Commented:
That was where I was headed, but you beat me to it.  I wasn't sure if you were using the full path.

Bob

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Cheers for help though Bob, Appreciate It

Andrew

:-)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.