Saturday, February 19, 2011

gacutill

To install an assembly in the Global assembly cache (GAC) I simply used to copy the .dll into the assembly (C:\Windows\Assembly) folder; This was Windows XP.
On Windows 7 though, the drag and drop won't work, it can only be done by using the gacutil.
we can do this by running the command prompt as administrator navigate to the folder where the gacutil and type gacutl /i <assembly> like C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin> gacutil /i c:\myassembly.dll .
There is also Mscorcfg.msc (.NET Framework Configuration Tool)
You can also install dll into the gac using the windows installer. To install an assembly using the Windows Installer, create a new installer project and click on the menu View the File System. On the left hand side, right click and select "add global assembly cache folder", click on the GAC then in the right hand side click add. Browse to the assembly to be installed and compile the project.
This is probably most effective for windows applications and installations.

Monday, February 14, 2011

monodroid

Java was never my forte, I did some Java swing apps in college for academic purposes, and that was it, so I was kind of hesitant to try out Android development, I started off from this site http://developer.android.com/resources/tutorials/hello-world.html
Now there is this android development in .Net with C# :) http://monodroid.net/
and yes it can be done right from VS 2010 see here http://monodroid.net/Tutorials/Hello_World The thing is the process starts off with installing Android SDK and configuring a simulator and install the plugin see here http://monodroid.net/Installation

Mono for Android also offers the following:
  • The same OpenTK library popular among .NET developers on Windows, Linux, iPhone, allowing you to share the same OpenGL logic across platforms.
  • Support for the full JIT (unlike iOS)
  • Templates for C# (but other .NET compilers should work, if they reference MonoDroid's libraries).
  • Last, but certainly not least, MonoDroid is now supported on Mac OS X.
source : http://www.androidguys.com/2011/01/06/mono-android-open-developer-testing/

Friday, February 11, 2011

Custom Validator

There are two ways to use the custom validator, the client side validation and the server side. I think the server side keeps thing simple, I was using one on my form, and I intended to use it on the client side i.e. call a function in javascript with two parameters like

function validate(sender args)
{
      //validation code
      args.isValid=true; //or false
}
the validator itself has the OnClientValidate=validate()

I was saying the server validation does not slow thing its almost equal in time limit to the client validation.
The server side validation is similar have a validate function that returns isValid:

protected void validate(sender as Object, args as ServerValidateEventArgs)
{
//validation code
args.isValid = true // or false
}

I did put the validation into an update panel, like

<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Error" ClientValidationFunction></asp:CustomValidator>
            <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="Error" OnServerValidate></asp:CustomValidator>
....

Maybe that did something to the updation of the control 

Wednesday, February 9, 2011

Vanity GUIDs


Heard about Vanity GUIDs , Apparently these king of GUIds are ubiqu but have pattern to them embedded in their text . They can be used for Branded software (e.g., your company or product ID), Debugging (no idea) or humor read this article for more on C#411 . And you can see some code there to make them.
I foound a comment down there interesting
Mike writes:
You can't guarantee that a System.Guid will be globally unique either, to the point of it being fairly pointless using the Guid class to create a few billion GUIDs just to force retrieve what is essentially a manually created one anyway.
may god have mercy on your soul


Its usage might get a little offbeat.