Click here to Skip to main content
15,916,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have written an Win Forms applicaiton that is used to encrypt various web configuration files with RSA - making use of Microsoft Server 2008. The thing is that I have receive the following exception when trying to opne the configuraiton file (I am not making use of the Default Web site) - on the following line in the code:

Configuration config = WebConfigurationManager.OpenWebConfiguration("/", "SiteName", null, Enviorement.MachineName);


The strange thing is that it works on another Microsoft Server 2008 machine (Testing enviorement), but the clients Server gives the exception.

I have looked at the following web sites (WebConfigurationManager.OpenWebConfiguration() - Failed to resolve the site ID
[^]) but did not provide an answer.

Could anyone please help me?
Many thanks in advance.
Kind regards,
Posted

1 solution

Add a @ before the "/" as the forward slash is probably escaping the string
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900