?
Solved

Modify Config file

Posted on 2013-01-22
2
Medium Priority
?
276 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 1500 total points
ID: 38808859
0
 

Author Closing Comment

by:praveen1981
ID: 38825736
Many thanks.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Simple Linear Regression
Introduction to Processes
Suggested Courses

770 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