MugBug Day 1

I searched a lot, But was not able to find a bug tracking system based on ASP.Net MVC. So, I decided to build this as my learning project. I decided to use Sharp Architecture to start with.So, first thing is to download it SharpArchitecture_1.5_Beta1.zip. I am using Windows 7 , VS 2010 with ASP.net MVC 2 installed . So, instructions are specific to that only. After downloading unzip the file in “C:\Users\mthakral\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\Web” . If “Web” Directory is not there then create it . Zipped File would contain another zip file and one dll. Unblock the zip file as well(Right click and then unblock). Add the dll to GAC. For Visual 2008 you can follow the instruction given at :: Setup Sharp Architecture.

Then go to VS 2010 new Project-> Visual C# -> Web -> Choose “Sharp Architecture” ,
Project Name MugBug and It will start creating bunch of projects for you. It will show you some database related dialog box, Just cancel those. You will see 2 errors in tt templates.(Atleaset, I was getting those). But, I ignored those and tried making a build. It build successfully.But, out of 9 projects 3 were skipped by default. Then, I tried running and it failed with some Global.asax error on “NHibernateSession.Init(“. I think this was because of database. So, I went ahead created a database and it user. Placed those values in Y:\MugBug\app\MugBug.Web\NHibernate.config. After this, I was able to run my app for the first time. and then as the page suggested, I executed the unit tests. After that, I could see two errors in T4 templates something like
Error 19 Compiling transformation: Metadata file ‘Inflector.Net.dll’ could not be found
Error 20 Compiling transformation: Metadata file ‘SharpArch.Core.dll’ could not be found

Thats if for day 1, time to go for a shower and then office. C ya

Now, I am facing some random issues with tt generator.

ASP.Net Ajax, jQuery,Telerik Controls and jQuery Tools Conflicts

Hi All,

As I work for the team that develops reusable components for the whole organization, I found some of these issues and their solutions while using ASP.Net Ajax, jQuery,Telerik Controls and jQuery Tools.
First of all, using Telerik control “RadScriptManager” you can add jQuery as they provide a default implementation of jQuery,
Now the setup was something like this and I am sure it is a kind of trivial setup that you may find almost everywhere. So, in this case, using RadScriptManager I was adding jQuery after that using following line

var jQuery = window.jQuery = window.$ = $telerik.$;

I was restoring $ as default jQuery as alias, telerik controls change the alias and make it as $telerik.$.
After that I was adding bunch of other plug ins to jQuery using a separate file.Now in the page, I was adding jQuery Tools using there cdn link “http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js”. Now the tricky part is that cdn link also contains jQuery.So, it removed all the plug ins I had and now I have $ pointing back again to jQuery, But without any plug ins.

This caused my javascript to start showing an error “Some function not found”. I tried debugging it using Firebug and found that plugin was getting added to the alias and then it was available till the point cdn was getting added. Voila, I found the bug. My mistake

So, lesson learned whenever you are using CDN, Understand first what it has :)

Talk to you all later.

Creating Web Application in IIS 7.5 Windows 7/Windows Server 2008 R2 using powershell

Hi All,

Back again with one more research of mine,This time it is about creating a virtual directory/web application in IIS using powershell.

I have executed this script in IIS 7.5, Windows 7 32 bit Pro. But, I think it should work with 2008 R2 as well.

Import-Module webadministration
Set-Location 'IIS:\Sites\Default Web Site'
if (Test-Path '.\Mockups')
{
Remove-Item '.\Mockups' -Recurse -Force
echo 'Mockup Deleted'
}
New-Item '.\Mockups' -physicalPath 'Y:\Mockups' -type Application
Set-Location '.\Mockups'
if (Test-Path '.\WebInternal')
{
Remove-Item '.\WebInternal' -Recurse -Force
echo 'WebInternal Deleted'
}
New-Item '.\WebInternal' -physicalPath 'Y:\Mockups\SourceCode\WebInternal' -type Application
if (Test-Path '.\WebExternal')
{
Remove-Item '.\WebExternal' -Recurse -Force
echo 'WebExternal Deleted'
}
New-Item '.\WebExternal' -physicalPath 'Y:\Mockups\SourceCode\WebExternal' -type Application

First line is important else you would not be able to access the IIS:\ root directory, What this line does is that it imports the web administration module in powershell,

after this first line IIS becomes available to you as a root folder that you can manipulate using commands. Directories that I am trying to create in this are Mockups then under Mockups WebInternal and WebExternal. Please put comments for any questions. Attached is the actual script.

C ya later.

Detailed Comparison CSS and JS Minifiers

From past couple of days. I was researching on a css/js minifier. I started with css. Since, recently my company decided to use Telerik Rad Controls, but as expected they wanted to customize look and feel. Here comes the

Problem :-

24 unrelated css files. So, Either we have to inspect the page to identify the controls being used or I could put one link in my master page that delivers all of these 24 css files as one request after minifying, gziping and maintaining a cache on the serverside.
Along with that there might be custom css files as well, and i wanted the support of .less files as well.

I could have used telerik rad stylesheet manager.But I dont think it minifies cssfiles.it jst delivers all of them in one request as gzipped

So all in all.My requirement is to minify,gzip and server side cache css and JS files in a directory. and in this post I am gone compare options available to me

Solution :- Following were my options.

1. Use YUI compressor port
2. Use Microsoft Ajax Minifier 4.0
3. Use Bundler by Justin Etheredge
4. Use Dot Less Css
5. Use Shinkensen
6. Build a custom one.

So, Here is the table of comparison :)

Work in Progress…

Hello world!

Yes, I will use the same title since, It is pretty much the first program that we write. Today i decided to start writing my blog in free time. That i doubt i will have any but let us see how it will go. Wish me luck guys…