Rbm Visual Studio Eye Friendly DarkTheme

April 23, 2009 · Posted in Visual Studio · 2 Comments 

Rbm-DarkTheme.zip

Introduction

Recently I have passed through a very cool Theme For Visual Studio 2008 it’s called TaznimSaqib-DarkTheme I found it a very nice theme indeed and very comforting for my eyes so since I use Both Visual Studio 2008 and Visual Studio 2005 I decided to make a similar one for Visual Studio 2005. you could find a screenshot to the theme below

screenshotcode

Setting the Theme in Visual Studio

For setting the theme click on tools -> Import and Export

Then select Import Selected Environment Settings, In the next page select save my current settings and press next. Then browser for the settings file that you could download from above. Then select next then finish.

Hope you enjoy the theme and you find it cool to use. Share your thoughts :)

Running Fiddler on LocalHost

April 20, 2009 · Posted in Fiddler · Comment 

Fiddler is an awesome tool for Web Debugging which logs all HTTP(S) traffic between your computer and the Internet. To run fiddler on your localhost you could simply place a “.” after the localhost e.g. http://localhost:4433/MySite/ => http://localhost.:4433/MySite/ Notice the “.” after localhost however sometimes this doesn’t work on vista so you could try either putting your computer name instead of localhost or the loop back IP e.g http://127.0.0.1.:4433/MySite The “.” is still there after the IP.

Hope you enjoy it, please share your thoughts

Deploying Custom Tool using a Setup Project

April 8, 2009 · Posted in .NET, ASP.NET, C# · 3 Comments 

CustomToolDeploymentForVisualStudio.zip

Introduction

Making a custom tool work on the developers machine require several actions like placing keys in the registry and registering your DLL Library using the regasm command. This post will discuss the automation of this procedures using a setup project. for more information on making your own custom tool visit my post Building a Custom Tool Generator For Visual Studio

Using the Code

First add a class in your CustomTool Library Project that inherits from the Installer class in this class override two methods the first is the Install Method the Second is the Uninstall method.

To Get the regasm.exe path you could use the InteropServices.RuntimeEnvironment class to get the runtime directory of the .NET framework. Then you need to get the assembly location. After that you could simply start the process of the regasm and pass to it the /codebase parameter and the path of the library.

public override void Install(System.Collections.IDictionary stateSaver)
{
    base.Install(stateSaver);
    string regasmPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + @"regasm.exe";
    string componentPath = base.GetType().Assembly.Location;
    System.Diagnostics.Process.Start(regasmPath, "/codebase \"" + componentPath + "\"");
}

To uninstall remove the component registeration by the /unregister parameter

public override void Uninstall(System.Collections.IDictionary savedState)
{
    base.Uninstall(savedState);
    string regasmPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + @"regasm.exe";
    string componentPath = base.GetType().Assembly.Location;
    System.Diagnostics.Process.Start(regasmPath, "/unregister \"" + componentPath + "\"");
}

The Setup Project

Now make a new setup project and add the output of the CustomTool Library to it. Then Right Click the setup project and select view then select custom actions.
customactions2
Then Add the CustomTool Project Output to the Install and Uninstall Sections as in the image below.
customtoolsetup
ok now you need to add the registry values right click on the setup project and then View then select Registry To add the Needed Registry Values follow the structure in the figure below.
customtoolregistry

Share your Thoughts

Now all you have to do is just build the setup project :) and you will have a setup deployment for your custom tool.
please share your thoughts and feel free to drop any comments. Hope you enjoy the project.

Building a Custom Tool Generator For Visual Studio

April 7, 2009 · Posted in .NET, C#, Visual Studio · 3 Comments 

CustomToolForVisualStudio.zip
BaseCodeGeneratorWithSite.dll

Introduction

Sometimes you need to generate your own code for some XML Files in your Visual Studio Project or replace the Resource File Generated Code of the Visual Studio with one of your the reason you may want to do this is that you may want to work with a custom resource provider while the generated code in .NET makes the static properties work only with the resource file.

Using the Code

First to do that you need to inherit from the BaseCodeGeneratorWithSite then generate a GUID for it from Tools -> Create Guid -> Then Select the Registry format and copy the guid to mark your class with this GUID Will let the Visual Studio later on know the class it should call. Then place a GUID and a ComVisible attributes on your class.

    [Guid("A2A52B1B-48A1-45af-A30E-8D86E4DE0D79")]
    [ComVisible(true)]
    public class CustomToolGenerator : BaseCodeGeneratorWithSite

Then Override the GenerateCode Method

   protected override byte[] GenerateCode(string inputFileName, string inputFileContent)
   {
        string code = "Generated Code Should Be Placed Here";
        return System.Text.Encoding.ASCII.GetBytes(code);
   }

If you want the namespace that the File is comming from it’s available in the “FileNameSpace” property of the BaseCodeGeneratorWithSite class.

In the AssemblyInfo.cs Class make the Assembly Com Visible by placing the following code in it

[assembly: ComVisible(true)]

Generate a Strong Name Key for your project using the Visual Studio Command Prompt sn -k CustomToolForVisualStudio.snk and bind your project to it- Right Click on the project then select Properties then Select Signing and choose Sign the assembly property and select the Strong Name Key you have just generated

For Registering the Generator in the Visual Studio you need to place a reference to it in the Registry
Visual Studio 2005
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Generators\
Visual Studio 2008
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Generators\
These are the sub keys for different languages they are named with their GUID you will go inside them
{164B10B9-B200-11D0-8C61-00A0C91E29D5}: Visual Basic
{E6FDF8B0-F3D1-11D4-8576-0002A516ECE8}: J#
{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}: C#

Then Create a key with the name of your class and inside it place the following
(Default): String: CustomToolGenerator (name of the custom tool)
CLSID: String: {A2A52B1B-48A1-45af-A30E-8D86E4DE0D79} (Generated Guid)
GeneratesDesignTimeSource: DWORD: 1

Now Register you Assembly using the resgen command in the Visual Studio Command Prompt

regasm /codebase CustomToolForVisualStudio.dll

Using the Custom Tool in Visual Studio

Right Click on a Resource File or XML File and click properties then place in the CustomTool property the value “CustomToolGenerator

The Custom Tool will now generate the code based on the code given in the “GenerateCode
” Method.

Hope you like it :) Please share your thoughts

























































download movies

ñêà÷àòü ôèëüìû