Finding what you need in the Microsoft® Visual Studio® 2005 documentation, which has over 200,000 topics, can be a daunting task. The Doc Detective is here to help, utilizing his investigative skills to probe the depths of the documentation.
Can’t find what you’re looking for? Just ask-if it’s in there, I’ll find it for you; if it isn’t, I’ll let you know that as well (and tell you where else you might go to find it).
Have a question for the Doc? Send your questions for future columns to me at docdetec@microsoft.com.
Dear Doc Detective,
I am very new to the .NET development field. I recently developed my first Windows application in C# and created a Setup project to install it. Since it was my first attempt at a Setup project I put it in a "Test" directory rather than in the same directory as my application.
The Setup worked fine, and now I want to change the output of my Setup project to my application directory. I found the topic "How to: Change the Build Output Directory" in the documentation that suggests that I can change the Output Path on the Build properties page.
M problem is, there is no Build properties page Output Path option for Setup projects. Am I stuck with my Setup project in the Test directory?
- Put Out in Pawtucket
Dear Put Out,
You can always move your application project to the Test directory... or you can easily change the Output Path for your Setup through the Setup project’s property page. To access the property page, select the setup project in Solution Explorer, right-click and choose Properties.
It doesn’t help that the property is named “Output file name” instead of “Output Path”, but they do the same thing. Just enter the path where you want the built Setup.exe and related files, and the next time you build they will appear there. This is covered in the topic, "Build, Configuration Properties, Deployment Project Properties Dialog Box".
The topic that you mention is indeed misleading-the Doc has contacted the author and asked him to add a note explaining how to set the Output file name in a Setup project.
- Doc D
Dear Doc Detective,
I am looking for a way to catch all exceptions and log them in a console application. Currently I have this wrapper around all my public methods:
Try
' ....code...
Catch ex as exception
Logger.LogException(ex)
Throw
End try
This works but must be repeated everywhere. I tried to reference UnhandledThreadException in my constructor but it did not catch anything, and Application.ThreadException is only available for Windows Forms applications. Is there an easy way to do this?
--Exasperated in Exeter
Dear Exasperated,
Easy is a relative term-there is a way to do this; whether or not it’s easy is your call. To catch exceptions at the application level, you can use the AppDomain.UnhandledException event. It allows the application to log information about the exception before the system default handler reports the exception to the user and terminates the application.
By the way, if you ever need application-level exception handling for a Visual Basic Windows Forms application, there’s an easier way than using Application.ThreadException. Visual Basic provides an UnhandledException event that you can use to catch exceptions that aren’t caught at the Method level.
The event is part of the Visual Basic Application Model, which also includes events for handling the application’s startup and shutdown. See the topic, "Overview of the Visual Basic Application Model" to learn more.
- Doctor D
Dear Doc Detective,
My boss has asked me to create software for our clinic. Can you give me some tips on how to do this?
- Clueless in Cleveland
Dear Clueless,
Sure, just look for the topic, "How to: Create Software for a Clinic with Just Three Lines of Code". Seriously though, the Doc gets questions like this all the time. I have to assume that you aren’t an experienced programmer (although you may have stayed at a Holiday Express last night).
If you are new to programming, I would suggest downloading the free version of Visual Basic Express and “kicking the tires”. The best way to get started is by working through the Visual Basic Guided Tour, a series of step-by-step lessons that will introduce you to Visual Basic.
- Doc D
Doc’s Doc Tip of the Day
Are you interested in finding out what’s coming in the next version of Visual Studio, but you don’t want to (or can’t) download the Beta version? The documentation for the Visual Basic Codename Orcas Beta is available now in the MSDN Online Library.
Although the Beta documentation is incomplete and subject to change, it can still give you a good idea of what’s coming. The best place to start is the topic "What’s New in Visual Studio 2008", which provides links to all of the new and updated features.
Found a topic in Help that doesn’t help? Tell the Visual Studio documentation team about it at vsdocs@microsoft.com.
URLs
http://msdn2.microsoft.com/en-us/library/1befw7hy(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx
http://msdn2.microsoft.com/en-us/library/3a02k5s0(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/w3xx6ewx(VS.80).aspx
http://msdn2.microsoft.com/en-us/express/aa975050.aspx
http://msdn2.microsoft.com/en-us/library/90h82b3x(VS.80).aspx