473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Exception when using System.Management class

271 100+
Hi Experts,

i have created a web application which has an option to edit the web config file from the web page. when i create an installer for this project using web setup project in VS2008 and install it, the codes are copied to the virtual directory under Inetpub. when i try to edit the web.config file it throws an exception access is denied to web.config file.
but the same project works fine if i copy the file to some other location and manually configure them to the IIS.
so i have modified my code to add the ASPNET user to the virtual directory with full rights using System.Management class. this also works fine if the code is outside the Inetpub folder. if i create an installer for this this throws the below error.
"System.Management.ManagementException: Access denied at System.Management.ManagementException.ThrowWithExt endedInfo(ManagementStatus errorCode) at System.Management.ManagementScope.InitializeGuts(O bject o) at System.Management.ManagementScope.Initialize() at System.Management.ManagementObjectSearcher.Initial ize() at System.Management.ManagementObjectSearcher.Get() at DataBaseConnections.setRights() in c:\Inetpub\wwwroot\AurasavGUI\DataBaseConnections. aspx.cs:line 50 "

requesting you for some ideas to overcome this issue.

Thanks and regards
karthi
Mar 4 '09 #1
2 4605
PRR
750 Expert 512MB
what you have done is correct.. i dont understand why you are getting system.management error ...can you throw some light on that ?
Mar 4 '09 #2
karthi84
271 100+
Hi Deep Blue,

I hope this could be the cause. the system is not allowing the ASPNET user to alter the permission of its folders. any way i have achived my requirement using a third party installer.

Buit still doing some research on how to solve this issue. If i found a solution for this i will soon post here.

Thanks for the help.

Thanks & Regards
Karthi
Mar 6 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Páll Ólafsson | last post by:
Hi I have a problem with the Microsoft.ApplicationBlocks.ExceptionManagement? I can't get it to work in RELEASE mode? If I run the project in debug mode the block works fine but when I run the...
5
by: PCC | last post by:
I am using the Exception Managment Application Block on Windows Server 2003 Enterprise and .NET v1.1. If I use the block with an ASP.NET web wervice or in a web application I get the following...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
4
by: Atul Bahl | last post by:
We want to use one static class that can be called from anywhere in application and provides all the notification mechanism behind the scenes and can be used to handle exceptions all over the...
1
by: SQLJunkie | last post by:
Hi, I have installed SQL 2005 RTM on a new server and I keep getting this error (described below) quite frequently. Was wondering if anyone has a clue on what's happening here. I tried googling...
1
by: Christian Havel | last post by:
Hi, on shutdown I receive the exception ReleaseComObject. Following the call stack when the exception occures. ...
16
by: Chuck Cobb | last post by:
I'm implementing a centralized exception handling routine using the Enterprise Library Exception Management Application Block. I trap all unhandled exceptions to one place using the following...
2
by: KaNos | last post by:
Hello world, I've made a webservice (c# v2) to install in a server IIS 6 on a Windows 2000 last SP. We can use the webservice in local, throw the pages wich present the methods, with a windows...
4
by: diyasher | last post by:
hello while running program that use system.management namespace and holds management event the exception throws "not found" and some time "not supported" unhandled management exception on...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.