|
There has been an article recently about adding a help button (while keeping
minimize and maximize). Search for it!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Using Vista and VS2005...
I'm working on a windows service which requires the use of the JITdebugger. When I start the service, it's supposed to automagically fire up the debugger, but I get the following error in the Application event log:
An unhandled exception ('Launch for user') occurred in vPopcorn_Service.exe [3220]. Just-In-Time debugging this exception failed with the following error: Either a required impersonation level was not provided, or the provided impersonation level is invalid.<br />
<br />
Check the documentation index for 'Just-in-time debugging, errors' for more information.
I'm off to research it, but I figured I'd post a question here in the mean time.
If anyone has any ideas, I'd be happy to entertain them.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Did you find an answer to the question?
I tried Debugger.Launch and it seems to work fine and yes I have UAC enabled.
How is the service running (what account is it using)? It seems to me that the service is running under an account that does not have SeImpersonation privilege (my guess).
|
|
|
|
|
Rama Krishna Vavilala wrote: Did you find an answer to the question?
Nope.
Rama Krishna Vavilala wrote: How is the service running (what account is it using)? It seems to me that the service is running under an account that does not have SeImpersonation privilege (my guess).
I've tried it under both "Local System Account", as well as my own.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is your account an Administrator (barring UAC)?
|
|
|
|
|
Ok
Here are my findings:
1. If you are an administrator (meaning member of administrators group but running under UAC) the Debugger.Launch always works. It does not matter what account the service is running on.
2. If you are not an administrator you need to run the service under your account and you need to have SeDebugname privilege. An administrator can grant that privilege to a user by launching "Loacl Security Policy". It appears as "debug Programs" under "Users Rights Assignment".
3. If the service is not running under the same account as the you than the debugger cannot attach as it fails to inspect the processes identity. I think it can be done by injecting a dll and modifying some ACLs, something similar to this article: http://www.codeproject.com/macro/clrdebugenable.asp[^]. I will have to research further.
So I will say go with 2.
|
|
|
|
|
I'm in the administrator group, but I don't have permission to modify the registry. The service is running under the "Local System" account.
I'll look into item #2.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I don't see the point in using #region . It doesn't appear to affect the compile in any way.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I don't see the point in using #region. It doesn't appear to affect the compile in any way.
It's just a way to organize your code. For example, you could have a class skeleton with the following regions:
public class MyClass : ISomeInterface
{
#region MyClass Members
#endregion
#region ISomeInterface Members
#endregion
}
I usually add nested regions for segregating properties, methods, contructors, and fields. Sometimes I use regions within methods to mark off guards, preconditions, postconditions, etc.
When I first started using C# with Visual Studio, I was skeptical about the benefit of regions, but I've found them helpful in navigating my classes.
|
|
|
|
|
Aye, they can make navigation very quick if used right
|
|
|
|
|
How do they "make it quick"? I use "comments". How are regions better than comments?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
This is my personal preference on how i use them.
I have my class and it has:
public class MyClass
{
Fields
Properties
Constructors
Methods
}
I want the event handler method for the OK button.
I'd double click "Methods" which expands it out.
I'd then have:
#region Methods
SomeMethod
SomeOtherMethod
EventHandlers
#endregion
double click "EventHandlers" which gives:
#region Methods
SomeMethod
SomeOtherMethod
#region EventHandlers
Buttons
ComboBoxes
TextBoxes
#endregion
#endregion
and finally Double Click "Buttons" and find my method ... normally i wouldn't region any further than that as you don't tend to get many methods inside that low region.
so with 3 double clicks i've gotten to exactly where i want to be without having to scroll (much) or type anything.
|
|
|
|
|
With regions you can collapse them which allows one to focus on only the region being looked at or modified. The text that is placed after the #region is also displayed. I've used them for C# and they do come in quite handy when you are searching for a specific area of code. As mentioned by someone else on this thread, they must be used properly to be of benefit.
Phil
|
|
|
|
|
That's the kind of reason I was looking for - they're collapsible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Furthermore they occasionally are expandable.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
But only when the wind is blowing from the North West
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Regions provide a collapsable area that allows you to group related code items together. When collapsed, you only see the "title" of the region so it helps eliminate the background noise and lets you focus on just the code you need to see at that moment.
|
|
|
|
|
You collapse the sections. When you mouseover the heading (region caption) you see the full code as tooltip. This avoids unnecessary scrolling up and down, hither and thither of the entire webpage.
|
|
|
|
|
Yeah, and they don't work in Notepad!
They're not really a feature of the language at all, they're more a hint to the IDE.
You can also collapse functions and whatnot individually, but regions allow grouping the contents of a whole umm... region of code.
|
|
|
|
|
Hi friends,
any one can advice me how i switch to http url to https using .net and c#?
Suggest some articles, urls or dummy codes.....
Thanks
Nithin
|
|
|
|
|
|
Hi
I am trying to setup an automated emailing in my asp.net applications, so that i can send out new passwords to users and also send out invoices once an order has been completed
I have been looking around on the web, but I can't see much on the web to help do this
Has anyone got any suggestions or links that would be helpful
cheers boyindie
|
|
|
|
|
|
hi
i want to add installer class to my setup.
do any one have good example for that. iwant to call rollback event when condition fails . pls give me some guidence on installer class
i am using .netframework 2.0 vs 2005
with regards
Balagurunathan.B
|
|
|
|
|
How can we send a POST request to some server in code. I actually want to redirect users to some page and send some parameters to that page using the POST method . How can I do this in code ??
|
|
|
|