Solved

Modify Config file

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

733 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