Finding what you need in the Microsoft® Visual Studio® 2008 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,

A few issues back, Bored in Baltimore asked about creating an application-level icon that would show in Windows Explorer.

I’m not sure what version of Visual Studio the proposed answer was for, but the instructions don’t seem to work for me. I have a Visual Studio 2005 Visual Basic project and have specified the application icon at the properties--application--application icon level and the one I chose doesn’t display on my system. Does it have to be a specific size of icon to be displayed under Explorer?

-Iconless in Iowa

Dear Iconless,

I just tested this again in Visual Studio 2005 and it works for me. Perhaps you are confused as to what the application icon is.

It is the icon that shows up in the folder for the application in Windows Explorer, and also in the Start menu if you have configured the app to appear there. It is not the icon that appears on the form itself or in the Taskbar-that is controlled by the Icon property of the Form.

The Application icon property is described in the topic "How to: Specify an Application Icon." The Icon property is described in the topic "Form.Icon Property." And to answer your question, no, size doesn’t matter.

-Doc D

Dear Doc Detective,

I have been working on this for far too many hours. All I want to do is copy a resource file to a directory on the drive where the program is being executed. I am trying to copy a .jar file. Below is the module I have created to do this:

Imports System.IO
Imports System.Reflection
    
Module Module1
    
Sub Main()
    Dim currentAssembly As Assembly =
      Assembly.GetExecutingAssembly()
    Dim streamName As String = "iPhoneShop.jar"
    Dim contents As String
    
    Using source As Stream =
      currentAssembly.GetManifestResourceStream(
      GetType(Module1), streamName)
        Using input As New StreamReader(source)
            contents = input.ReadToEnd()
        End Using
    End Using
    
    Using output As New
      StreamWriter("C:/iPhoneShop.jar")
        output.Write(contents)
    End Using
End Sub
End Module

This does not throw any errors; however, when the file is copied, it is about 2x the size and is corrupt. I have used this same module with no problems at all in the past to copy .mp3 and .txt files. My.jar file is in my Resources folder with the Build Action set to Embedded Resource. I am beginning to think that this is impossible...

-Wasting away in Wisconsin

Dear Wasting,

I’m not familiar with the .jar file type-a quick scan of the Internet suggests that it is some sort of archive format. If this is the case, it is likely that the StreamWriter class is unable to serialize and deserialize compressed files properly.

At any rate, you may be overthinking the situation. If all you want to do is copy the file, you really don’t need to use Reflection and streams-you should be able to do it with functions in the My namespace. The following code should work to copy the file from your application directory to another location:

Dim source As String
Dim dest As String
    
source = My.Application.Info.DirectoryPath &
         "\iPhoneShop.jar"
dest = My.Computer.FileSystem.
           SpecialDirectories.MyDocuments
    
My.Computer.FileSystem.CopyFile(source, dest,
                                True)

The lesson learned here is that when it comes to .NET, if you think something is impossible you are probably thinking too hard.

-Doc D

Dear Doc Detective,

This isn’t exactly a documentation question, more like a pet peeve. With each new version of the .NET Framework, we have to install a huge redistributable file on each end-user’s computer if we want to target the latest and greatest features.

While this is fine for users with plenty of excess disk space and a high-bandwidth connection, it creates problems for our users that don’t have the space or the bandwidth. We only deploy Windows client applications, so why do we need to install the parts of the framework that don’t apply? Is anything being done to help address this situation?

-Peeved in Pennsylvania

Dear Peeved,

Funny you should ask-the recently announced (and strangely named) .NET Framework Client Profile should address your concerns. It’s an abridged version of .NET Framework 3.5 that does two primary things: it allows people to run Visual Studio 2008 applications even if they don’t have .NET Framework 3.5 installed, and it’s a much smaller runtime than the full 3.5.

Basically it provides a streamlined subset of Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and Click One features. In other words, only what you need for WPF, Windows Forms, WCF, and console applications.

Still in Beta at the time that I am writing this, it is included in Visual Studio 2008 Service Pack 1, which should be publicly available by the time this goes to print. Ask, and you shall receive...

-Doc D

Doc’s Doc Tip of the Day

A reader recently reported that they “lost” the Help for the Interop Forms Toolkit-I checked on my own machine, and to my surprise my Interop Toolkit Help was missing from the MSDN Library as well.

Apparently the problem was caused by some other product that was installed after the Toolkit that had an error in its Help merging code, unintentionally clobbering the Toolkit Help. In this case, the directory for the Toolkit contained a "Register_InteropFormToolkitHelp.bat" file that fixed the problem by re-registering the Help collection.

Other problems with Help registration may not be so easy to figure out. The newly released Microsoft Namespace 2.0 tool can help. It allows you to inspect Microsoft Help 2.0 collections and, among other things, fix registration problems. You can find it in the MSDN Code Gallery, and best of all it’s free.

Found a topic in Help that doesn’t help? Tell the Visual Studio documentation team about it by clicking the “Send feedback” link in local Help topics, or the “Click to rate and give feedback” link in online Help.

URLs

http://msdn.microsoft.com/en-us/library/339stzf7(VS.80).aspx

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.icon.aspx

http://msdn.microsoft.com/en-us/library/36xbexyf.aspx

ms-help://MS.MSDNQTR.v90.en/wpf_conceptual/html/f0219919-1f02-4588-8704-327a62fd91f1.htm [Editor’s Note: At publication time this URL wasn’t available yet. Search for the topic ".NET Framework Client Profile”]

http://code.msdn.microsoft.com/NamespaceSharp