Solved

Modify Config file

Posted on 2013-01-22
2
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 …
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…
Progress

690 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