Mittwoch, 12. April 2006

Use Windows Explorer to copy Debug Symblos to the GAC

For those of you debugging GACed assemblies like me, you know its a little bit painfull to copy the debug symbols to it.

You should write a batch file for that purpose, but you have to go to the command prompt and type in the directory names and the mark and copy it.

To save a few key strokes, use the good old subst dos command.

  1. first type subst g: c:\windows\assembly
  2. the use the windows explorer and navigate to the g: drive
  3. and volia, you can click through the gac

Dienstag, 11. April 2006

Funny Messages

Very funny Messages, some from very known apps.

Check out the Pop-Up Potpourri @thedailywtf.com:

First one

Second One

Third one

Fourth One

Fifth one

Binary Serialization Code Snippet

In addtition to the wonderful new Code Snippet Functionality in Visual Studio 2005, i provide a binary serialization code snippet for C#. This is only to save to a binary File.

The Code Snippets from Microsoft, available here, have only the Xml Serialization.

Just put it in your #PROGRAMFILES#\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C# Directory.

Have phun,

tingle

<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="
http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Write Class Data to a Binary File</Title>
<Author>Joerg Brunke</Author>
<Description>Writes the data from a class to a Binary file using the BinaryFormatter class.</Description>
<Shortcut>binWriteClass</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>filename</ID>
<ToolTip>Replace with name of the file to write the data to.</ToolTip>
<Default>Data.bin</Default>
</Literal>
<Literal>
<ID>dataInstance</ID>
<ToolTip>Replace with the instance of the class containing the data.</ToolTip>
<Default>dataToWrite</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[using(System.IO.FileStream fs = new System.IO.FileStream(@"$filename$", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write))
{
try
{
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
bf.Serialize(fs, $dataInstance$);
}
catch(System.Exception ex)
{
}
}$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>