473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception when using System.Manageme nt class

271 Contributor
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.Manageme nt 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.Managem ent.ManagementE xception: Access denied at System.Manageme nt.ManagementEx ception.ThrowWi thExtendedInfo( ManagementStatu s errorCode) at System.Manageme nt.ManagementSc ope.InitializeG uts(Object o) at System.Manageme nt.ManagementSc ope.Initialize( ) at System.Manageme nt.ManagementOb jectSearcher.In itialize() at System.Manageme nt.ManagementOb jectSearcher.Ge t() at DataBaseConnect ions.setRights( ) in c:\Inetpub\wwwr oot\AurasavGUI\ DataBaseConnect ions.aspx.cs:li ne 50 "

requesting you for some ideas to overcome this issue.

Thanks and regards
karthi
Mar 4 '09 #1
2 4653
PRR
750 Recognized Expert Contributor
what you have done is correct.. i dont understand why you are getting system.manageme nt error ...can you throw some light on that ?
Mar 4 '09 #2
karthi84
271 Contributor
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
2130
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 exe file it doesn't catch any errors? Does anyone know what my problem might be? Regards
5
5816
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 error: ------------------------------------ System.Security.SecurityException: The event source ExceptionManagerInternalException does not exist and cannot be created with
44
4216
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 user tasks should always be included in a try/catch block that actually handles any exceptions that occur (log the exception, display a message box, etc.). 2. Low-level operations that are used to carry out the high level tasks
4
1375
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 application like 'try & catch'. Now the problem is we are getting the Error : 'System.Web.Management.WebBaseEvent(string, object, int, System.Exception)' is inaccessible due to its protection level. Or any other way to centralize the exception...
1
3392
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 but no success! This generally happens when I am browsing the tree in Object explorer in SQL 2005 Management Studio. I can be doing anything - like viewing databases, or viewing table list or viewing stored procedure list, etc.
1
1527
by: Christian Havel | last post by:
Hi, on shutdown I receive the exception ReleaseComObject. Following the call stack when the exception occures. mscorlib.dll!System.Runtime.InteropServices.Marshal.ReleaseComObject(System.Object o = <Nicht definierter Wert>) + 0x18 Bytes system.management.dll!System.Management.Instrumentation.MetaDataInfo.Dispose() + 0x15 Bytes system.management.dll!System.Management.Instrumentation.MetaDataInfo.Finalize() + 0x1b Bytes I already added...
16
2541
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 method: // --- Create an Exception Handler for Thread Exceptions ---------------- Application.ThreadException += new ThreadExceptionEventHandler(OnThreadException);
2
2249
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 mode connection (<authentication mode="Windows"/>) if impersonate is false (<identity impersonate="false"/>). Note that i use the administrator user to be sure. But when I change impersonate element (<identity impersonate="true"/>) a system...
4
3999
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 management event start() method, i am using windows xp professional sp2, the sample code is class Program { public static void Main(string args) { ManagementScope scope = new...
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9174
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8096
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2634
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.