Solved

Modify Config file

Posted on 2013-01-22
2
260 Views
Last Modified: 2013-11-13
Hi


i am using the following code

 string dummyVirtualPath = "/MyApp";

string strConfigPath = @"E:\abc\Web.config";

                        WebConfigurationFileMap map = new WebConfigurationFileMap();
                        map.VirtualDirectories.Add(dummyVirtualPath, new VirtualDirectoryMapping(strConfigPath, true));
                        Configuration config = WebConfigurationManager.OpenMappedWebConfiguration(map, dummyVirtualPath);

                        CompilationSection compilation =
                                            (CompilationSection)config.GetSection("system.web/compilation");
                        compilation.Batch = false;

                        if (!compilation.SectionInformation.IsLocked)
                        {
                            config.Save();
                        }

while executing i am getting following error


A configuration file cannot be created for the requested Configuration object.


can you please suggest what are the changes should i do further..
0
Comment
Question by:praveen1981
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 38808859
0
 

Author Closing Comment

by:praveen1981
ID: 38825736
Many thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now