Solved

Modify Config file

Posted on 2013-01-22
2
271 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

840 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