Permissions exception saving app config

B

Brad

I have some code for a .Net 2.0 winforms application which modifies the app's config file. The code works without error
for me, but when another developer runs the same code in Visual Studio debug he receives a permissions exception on the
statement
config.Save(ConfigurationSaveMode.Modified);

At the file/folder level he has full permissions and I would think we have the same default code access security. So
my question would be why the permissions error and what to do to resolve. I would also like to know if there any issue
in this to expect when deploying to production (to an end users pc)
 
P

Pete

Brad said:
I have some code for a .Net 2.0 winforms application which modifies the
app's config file. The code works without error for me, but when another
developer runs the same code in Visual Studio debug he receives a
permissions exception on the statement
config.Save(ConfigurationSaveMode.Modified);

At the file/folder level he has full permissions and I would think we have
the same default code access security. So my question would be why the
permissions error and what to do to resolve. I would also like to know if
there any issue in this to expect when deploying to production (to an end
users pc)

Brad,

I'm curious about this issue as well. I experienced it under .NET 1.1 on my
machine. None of the other developers (probably a total of about 30 or so
that had done development work on the app) ever experienced the problem, nor
have any of our users since. I was the "lucky" one.

In an attempt to fix the problem, I had a freak caspol accident (I think it
was caspol) and managed to deny the administrator access to the
\Windows\System32 directory. After reinstalling Windows, the problem went
away and haven't seen it since. I'm curious what the cause was, though.

Pete
 
J

Jeffrey Tan[MSFT]

Hi Brad,

Can you explain to me what "in Visual Studio debug" mean in your post? Do
you mean that the problem occurs only while the developer is using VS
debugger to debugging the code? Also, can you provide the permission
exception type and detailed call stack of this exception to me? This will
help us to give analysis.

Finally, is this problem reproducable on other machines? If so, is it
possible for you to create a little sample project to help me reproduce it
locally? Actually, this is the most efficient way to help me understand it
and debug it. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Brad,

Have you reviewed my reply to you? Does it make sense to you? If you still
need any help, please feel free to feedback, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top