.NET (RSS)

.NET

Excluding vwd.webinfo from adding to VSS from VS 2005

When I have a ASP.NET WebSite (NOT WebApplication), I notice the presense of vwd.webinfo in my VS 2005 solution. The problem is the annoyance when it shows as a new source control item. (with a plus sign next to the filename). So, when ever I do a "Pending Checkins"/"Checkin", it is included as part of the pending items.

At the moment I am taking care to uncheck this file and then do the checkin.

But, it would be nice to have tell VSS to exclude this file (or set of files) from trying to add to VSS.

I've also thought about "exclude from this project" option in Solution Explorer within VS 2005, but then it adds a file called vwd.webinfo.exclude and then this shows up in pending checkins once again.

Using the VSS client, there is a facility to include FileTypes. To my surprise, the *.webinfo was not included but still the VS 2005's VSS plug-in tries to add it.

I've never managed to get an solution to this problem yet. Hopefully something might turn out at a later time.

Windows Explorer view in Visual Studio.NET

It has so happened that after working with VS.NET for the past 3 years and having done only .NET Web Site development, now I have to program for the classic ASP pages. I have become very comfortable with VS.NET and would now like to use it for editing even the classic ASP pages.

The problem though is the unavailability (or unawareness) of a windows explorer view in VS.NET. Some other tools used by my colleagues here at Webnetism, have the windows explorer view. That makes it easier to just double click on the file in explorer and start editing it.

I am in lookout for a similar view in VS.NET! Hope to find some plug-in.

From VSS to CVS; From CVS to SVN

Hmm.....After VSS came CVS and now after CVS it's time to try out SVN!

Yesterday, I was finally determined to make my machine a build system(with WinXP SP2 Pro) for which I had to install and configure CruiseControl.NET. For which I had to install VSS. Then I thought of CVS (because, I was comfortable with CVS way of doing things for the past 1 year). Oh...then I thought of SVN (because, SVN is to be a compelling replacement for CVS).

The best part of SVN is the availability of the free e-book which is quite exhaustive. I was indeed more happy to read the TortoiseSVN e-book because it gave detailed steps to install the SVN Server and not just the TortoiseSVN Client.

Since I did not have Apache Web Server in my system, I prefered the SVNServe type of SVN Server which listens on port 3690. With that I had my svn server setup but before running the server, I read a piece of information in the book which said that the svnserve.exe can be run as a windows service using a wrapper called SVNService. Without much thought, I tried running the svnserve as windows service.

But, to my despair when I tried to view the repository which I had just created using TortoiseSVN, I could not find the repository using the repo-browser of TortoiseSVN. Something has gone wrong somewhere....After 30 minutes, I started to suspect the SVNService wrapper. So, instead of going to that level of abstraction, I decided to run the svnserve manually using command prompt. And lo there was Windows XP SP2 in action asking my permission to unblock the port 3690. Phew! that was a relief. After unblocking it, I reverted back to SVNService.

There ended my initial adventure with SVN which was quite less exciting than my earlier ones with CVS and TortoiseCVS. I am expecting the real thrill when I start using ASP.NET application with SVN.

A Virtual Day with Virtual PC 2004

Today was a day dedicated to Virtual PC 2004.

My colleague Ankur was the first one to have installed Virtual PC 2004 and have it up and running. His setup was quite surprising. He was able to install Virtual PC 2004 on a Windows XP Home edition. His GUEST machine was Windows Server 2003. Infact, Virtual PC 2004 does not officially support this setup. Ankur's need was quite different than mine. Since he had a laptop and a desktop computer he could afford for that kind of setup wherein he would be using the Windows Server 2003 for SQL Server 2000 and Source Control.

Since I don't have the comfort of having a separate physical server, I wanted to install Windows Server 2003 as my GUEST machine with the HOST being a Windows XP Professional. The idea was to create a Virtual Network with the HOST and GUEST being the only nodes in the network. The excellent help provided by Virtual PC 2004 came to use very much.

I had to first install the new network adapter(Microsoft Loopback Adapter) using Add Hardware Wizard on my HOST machine and provide the HOST with a static IP address (192.168.1.1) for the connection associated with LoopBack Adapter. The similar proceedure was followed in my GUEST machine with the IP address being 192.168.1.2. I also changed the number of network adapters for the GUEST machine in the Virtual PC Console to include the Microsoft Loopback Adapter.

I restarted my GUEST machine and expected my HOST to detect the GUEST. :-( That looked like a distant future for me. Basically I could not get it to work.

On googling, I found a link to a Virtual PC guy's blog which explains a subtle problem. A chicken and egg kind of problem is what he says. Oh...and here is the actual Virtual PC guy's blog. Now then, I had to realize it will take quite more strain to make this thing work or conclude that it will NOT work. At this point I give up for the day and go to reality by taking a nap and iterating on this stuff tomorrow........

-----------------------------------------------------

LINKS:

  1. A-Z on Virtual PC
  2. Virtual Server
  3. TechNet Virtual Server Technical Briefing in Edinburgh

My first experiments with NUnit and NAnt!

Finally I got a chance to use these tools (NAnt and NUnit)

The first to be used was NUnit 2.2 and had problems using it because I don't have permissions to install any assemblies into the .NET 1.1 Global Assembly Cache. So, I had to obtain the source and did the manual installation of copying all the required assemblies into a single folder. Then I set up the Path Environment variable to include path where these assemblies were put.

After doing this I went cruising my way creating cool unit tests for my own library under construction. It all worked fine and I used the NUnit-GUI  to test my applications.

Then came the second half of the fun! I had to now use the NAnt build tool. So, went ahead and downloaded the binaries for NAnt. As done earlier, set up the environment variable path. I was lazy and tried to use the build of my VS.NET projects using the <solution> task. Boom! A enormous list of errors and exception finally thrown at me by the NAnt utility. Now, I did not want to use the <solution> task and went ahead to create my own directory structure (deciding where each output should go into and also keeping in mind the NUnit tests to be run automatically by NAnt) and corresponding <target> task in my build.xml file.

The most frustrating or shameful mistake I did was to forget the fact that xml tagging is case sensitive. So, all I was getting was errors reporting FileNotFound. Spent nearly 2 hours in wain untill I was forced to get reminded of this fact that xml tagging is case sensitive!

And that is not the end of it! When tried to use the <nunit2> task got the exception that NAnt could not find the nunit.framework.dll assembly (as expected, because i have not installed the NUnit assemblies into the GAC and that is because I DON'T HAVE PERMISSIONS). Then I went on with the <exec> task to execute the “nunit-console.exe”. Now the whole fun started :) Again the problem of nunit.core and nunit.framework assemblies not found problem.

The problem was that I did not bother about nunit.core and nunit.framework assemblies when using the nunit-gui because they were in the same folder as that of nunit-gui.exe. But, now when I run nunit-console, the present working directory will be the location where the build file is present and thus nunit-console cannot find the nunit.core and nunit.framework assemblies. So, the only solution left for me was to copy the nunit.core and nunit.framework assemblies from the installed folder (the path is hard coded in the build file; I do not like to do that) to the present working directory. That solved the main problem. But I really failed in transforming the TestResult.xml produced automatically by NUnit-console to a proper html output using the “Summary.xslt”. Too much to handle for a single day may be..  So I am giving up on that and am contended with the error output files.

The immediate task facing me now is to use the al.exe for linking the modules just compiled using NAnt's build process into a single assembly and placing in the GAC. But hold on, I do not have permissions to install an assembly into the GAC! Instead, I have the SSCLI's GAC. hmmm, that would take more time I guess.

I just wish some kind of USER Specific GAC is provided in .NET! (or may be permissions can be granted to install the assemblies generated and strongly named by the CURRENT USER into the GAC). Got to look into .NET Operation documentation for all these stuff!

Ok. Now time to shift to Rotor and leave .NET for a while! Phew!

Why not read a book for your collegues!

I have now originally copied an idea from Rick. The idea is on how to make myself read a book. Rick started by writing out snippets (in his own words) from a book he was reading. Not just writing it for himself, he was sending them as mails to the collegues.

It so happened that for sometime such mails stopped which prompted me to mail him to ask about the proceedings. He said he shall continue doing it. Which makes him read the book.

I have also started to do something like that now. I am reading the “Essential .NET - The CLR” by Don Box. And not just that. In our internal forum, a new forum has been dedicated to this purpose. (email becomes cumbersome due to maintainance problems).

Advantages:

  1. I get to read the book as collegues expect something every day.
  2. I also get to summarize what I have read (best method to retain knowledge is to share it).
  3. Collegues also get to read the book at a glance.

got to code now.....

A different advantage of multi-language support in .NET

Today, I had to create the skeleton VS.NET solution along with the different .NET projects that would go into the solution for a new project at my workplace.

The reason I chose today as the day for this is that I could see someone starting to go ahead with the project development like some student hacking his way around. I have lost the patience to even look at such kind of coding. Worst is the case when there are files named “WebForm1.aspx” and “WebApplication1.sln”. If not today then never it will be. If substantial amount of coding goes into the project then the natural tendency to resist change occurs and the result is spaghetti code. ( ”Denial is the most predictable of all human responses” - from Matrix - http://www.neoandtrinity.net/)

In my previous ASP.NET web application project, majority of the time was spent on setting up the environment and learning new stuff.( VSS to CVS transition, 3-Tier Architecture, User Interface Process, Authoring Web Pages, Web Menu, User Controls, Authentication & Authorization, Coding Guidelines, Javascript and Asp.Net co-existence, DataGrids, Session Expiration, Understanding Struts to understand MVC, Deployment etc...). In fact, every damn thing was new. Not much time was devoted on implementing most of the suggestions in “Real-world tips for Real-world web applicationweb-cast by Paul D. Sheriff, President, PDSA Inc. Almost all the tips are right on target and gives the viewer enormous confidence and courage to immediatly try including them in their current project. And quite a few of the tips were incorporated. I was scared to experiment more due to the UIP application block being used (which in itself is mind-bogling stuff).

This project will not use the UIPAB and hence the decision to start with business logic coding only when all the real-world tips are included. At this precise moment, I've included 6 of 10 tips in this project (The coding for which started about 9 hours back). A more elaborate webcast on N-Tier programming (”Designing LOB applications using Asp.NET”) was refered and hence a different project folder structure has been adopted.

  1. N-Tier programming (done)
  2. Application Settings (done)
  3. User Interface
  4. Base Page Class (done)
  5. Track Users (next in the task queue)
  6. Exception Management (done)
  7. Session Variable Usage (done)
  8. Manage Unhandled Exceptions (done)
  9. Security (doing...)
  10. Performance

Now, let me come to the relation of this post with that of its subject. The code sample provided and refered by Paul D. Sheriff was written using VB.NET and the project I am developing is using C#. So, most of the time I had to replicate the code in C# for which I had to understand VB.NET code also. This process of looking at a code written in another .NET language and writting the same functionality in another .NET language is very fascinating. Some of the syntax I used to take for granted were made to understand.

Now, one might argue that this can be done with other languages also. Advantage in this case is that both VB.NET and C# uses the underlying FCL and thus makes it very easy to do the conversion and hence the learning. Imaging doing the same from Java to C# (I guess this might also be easy owing to the fact that many OSS existing in Java are now being written in C#).

I've now decided that to understand any code, best method is to re-write the code using some other language. I think VB.NET developers will get a better grip on Object-Oriented languages by using this technique.

Also, for the first time I have thought about the number of lines of coding that has gone in today. Stumbled upon the “devMetrics tool for C# code analysis and reporting. Unfortunately, It is not enabling the Analyze... option from the VS.NET 2003 IDE. But, I could generate the report using the Command Line facility and found that the amout of code written today by me is approx. 250 lines.

Ok... Time to take a nap and go home in the morning....

Training the non-techies on .NET!

“How to train the non-techies on .NET?“

“What should you start with and where to stop?”

These were just a couple of challenges I had to face this week at the training program organized at my workplace for the freshmen who joined our team a couple of weeks back.

The challenge becomes more interesting when the group consists of few computer science graduates and few non-computer science graduates.

There needs to be a balance in the amount of information departed. More technical terms, and the ideas will bounce off the non-techie group. Using more general terms to explain any stuff becomes more trivial for techies.

We'll the agenda was to instill the basics of .NET and a proper foundation so that the later sessions (C#, ASP.NET, ADO.NET) have no difficulty.

Keeping that in mind, I decided to use the same presentation I had used at the CorporateConnexion @ Christ College. On review, found that it was loaded with technical stuff and may bounce off even the techie freshmen.

So, that presentation now had to be trimmed.

First, I decided to instill the idea that:

  • .NET was not any single software
  • .NET has been mainly been developed to create Enterprise Applications

To get this idea instilled, used an anology of a House Construction and Enterprise Application Construction.

This made it possible to understand “Where exactly .NET fits into the Software Industry?”

The second half was to just clear the jargons surrounding .NET

Just displayed the various components of .NET that will be used to create an enterprise application.

  • The various types of applications that can be created (Web Application, Desktop Application)
  • The various role played by Asp.NET, Ado.NET, Web Forms, WinForms

The presentation can be found here

 

The arrival of Microsoft VS Team System

It makes me awe at the pace with which Microsoft is introducing new products. Added to that list is Microsoft VS Team System. Just the kind of product we wanted.

Got to appreciate the way this product was released. No clue about it till the last minute of announcement. Being a avid reader of the blogs, not many gave any clue about such a product. (or, have there been news about it? Not to my knowledge!)

While the attention was diverted in the blogs about new features in existing products (Office and Whidbey) or about features in some distant product (Longhorn), a silent product was under development with tight lips.

Now, is Microsoft creating a pattern for the usage of blogs. “Use blogs mostly for gaining/providing insights into distant/existing products”

This becomes evident as a blog being created immediately for VS Team System!

Any case, good going!

Lots of stuff ahead in 2005.

Finally, A Good Bye to Visual SourceSafe!

In my previous post on “Using CVS with VS.NET”, I've discussed the need to switch to CVS and also the problems faced in doing so.

After long time (nearly 2 months) my team has finally become very comfortable with using CVS and VS.NET. Looking back 2 months from today, I get reminded of those days when a whole day would be spent by me wondering who did what and what went wrong. With good push from my team-mate, Jimson, CVS was finally chosen as our Source Control. We did find a good plug-in called “Push-Ok” for VS.NET 2003. An excellent plug-in I should say. But, it came for a price.

We chose to stick on to Tortoise CVS and take the hard way around. We found that apart from files being edited by us, the VS.NET IDE also changed some files (like .csproj). Then with the help of Jimson, found out the right files to got into the CVS repository. Thus, after a half day session for the team on how to use “CVS with VS.NET” things got settled and now everyone seems to be comfortable with the “Copy-Modify-Merge” way of doing things.

A great feeling and a great relief....

Good going team.....

Working with ASP.NET UI Designer!

I had a requirement to develop a quick partially functional demo application. I chose to do the application using ASP.NET. Oh! It was a nightmare to create a web page with nearly 30 controls. The culprit was the requirement to place the controls aligned within tables. I thought it would be easy to do that once I had the controls on the page. It turned out to be a mess later when tables came into existence.

First, the controls could not be compacted within each cell of the table.

Second, confused whether to use the HTML view of Design view to create the pages.

Finally, I gave up and took the help of an expert (who had expertise in such table-driven web pages design using ASP). Even she had some surprises in store working with the Design view. It eventually turned out to be a remake of the entire web page loosing the existing controls.

In parallel, one of my team members discovered some way to create the aspx pages using the latest Dreamweaver MX. I looked far decent than the page we had done using VS.NET

Now that I need to work on some more ASP.NET applications, I am at the cross roads having many choices but just dont know which direction to take.

I don't get the process followed in creating ASPX pages. Is it that the web pages should be created by one person with all the necessary controls and then the functionality be added by another person or both the aspx and code-behind be done by a single person.

Just waiting to see a lighthouse........

Basic Integrated App using UIPAB and Forms Authentication

Just yesterday afternoon, when I thought of having a difficult weekend to crack the problem with UIPAB,  lightning struck. I got a reply to my question posted to news.microsoft.public.dotnet.distributed_apps redirecting me to GotDotNET workspace where a fix to the Back button problem with UIPAB was posted. God, that was timing. Had the reply come at sometime evening, I would have been spending my entire day today searching for alternatives for UIPAB (specifically Maverick) and working on it. ( I think i'll take some time off and try Maverick some time before UIPAB v 2.0 release).

As such, the Fix for Back button problem ( http://groups.msn.com/BDotNet/general.msnw?action=get_message&mview=0&ID_Message=12337&LastModified=4675459353602606026 for a description on the problem) did infact work out very well. I guess, the fix has been taken care in UIPAB v2.0.

With this fix, I managed to complete a Demo application integrating UIPAB and Forms Authentication yesterday evening.

The demo application will be used in my presentation on Monday to share my knowledge on UIPAB and Forms Authentication to my collegues.

Currently trying to use Data Access Applicaton Block in my demo application.

Also listening to DonBox's .NET Rocks Internet Audio Show (talking about Indigo,SOAP.....)

My Kata - Forms Authentication

Today's task of the day was to enjoy. So, the Kata was to experiment with Forms Authentication.

It has taken nearly a week to understand the Security Issues related with the ASP.NET application. Finally got a hang on Roles, Users,IPrinciple,Encryption and all other simple matters related to security.

The best part of today's Kata was that it got over is just 60 minutes (The last 60 minutes of the day).

Two more kata's are pending. One is to integrate the previous kata on Storing Encrypted passwords in Database with today's kata. The second is to integrate the resulting kata with User Interface Process Application Block.

Off to meet a friend and discuss C# Types.

The No-Linker concept in .NET

Yesterday night while returning to my home, dropped in to my friends startup company. It so happened that I had to talk about “Gettting started with C#”.

I thought it would be great to write the HelloWorld program and start disecting it. It so happened that, we went on to discuss on topics like:

  • Whats the difference b/w compiler and interpreter?
  • What happens from the time of double click of an windows application till some output is got? We had gone as far as to see what is an OS loader, how processor executes instructions, where are instructions stored and all those stuff which should have been discussed at the college days.
  • Defination of Object.
  • Seing the anology of an object and me.
  • Seing the anology of a class and human class.
  • Class methods and Instance methods.
  • Whats the difference b/w an *.exe and *.dll file
  • About PE file format.

The most important point of the talk was when I understood that .NET does not have the concept of a Linker .

There is no linker because there is no such thing like <include> statements in C/C++.

I could not resist to go deep further into the Metadata Tables and related basic stuff. Realized as to why Jeff Richter has given priority to Metadata and Assemblies in his excellent book “Advanced .NET programming”.

I am out to see whats the scenario in Java Technology case. (Recently lots of comparison is happening b/w Java Technologies and .NET) The best link of all is http://www.dwheeler.com/java-imp.html

 

C# Types

While having discussion with my friend yesterday, I realized that “There's plenty of room in C# Types”.

Some of the questions i faced were:

  • Why did they go for Value Types?
  • What is actually a Stack and Heap?

Many more fundamental doubts arised. I am now in quest for answering those fundamental questions.

The First, among the plethora of doubts would be to clear “How much memory is allocated in Stack and in Heap for a simple program like the one below?”

//simple.cs

namespace ManiSoft.Practice
{
    internal class Simple
    {
         public static void Main()
        {
            int x;

            x = 7;
        }
    }
}

Also wondering at

  • Is x a Value Type? (B'cause it is within a Reference Type)

Ok. Out to read some basic stuff from Jeff Richter.

ASP.NET Application Hosting

Yesterday, I was successful in hosting my sample ASP.NET web application over the free ASP.NET web hosting facility available at http://europe.webmatrixhosting.net

The best part was the usage of the System.Web.Mail namespace's MailMessage Type.

Pretty cool stuff I thought.

Just set the properties of the email message to be sent; choose the smtp server and lo, message is sent.

since my company's smtp server was temporarily not receiving mails, learnt about Relay server and other SMTP related stuff. (Thanks to my SysAdmin, Mr. Sudeesh)

Currently using hotmail's smtp server.

The smtp server was OK today and hence i can now use the Web.config to store the smtp server address.

All it took to put up two pages of functional ASP.NET site was 2 hours.

My sample application stands at http://ideamani.europe.webmatrixhosting.net

GTG Treking....

Back on Monday!

CLI and .NET

After a long delay, today got the chance to present the Common Language Infrastructure (CLI) presentation to my colleagues.

A very short, 20 minutes presentation. The shortest presentation of mine till now.

The Microsoft Powerpoint Slides can be downloaded from here(zip-290KB)

Related sites of interest would be:

2003 has been the most eventfull year for me (Stepped into .NET). Hoping to get more surprises and changes in the coming year.

Using CVS for SourceControl

"An alternative to VSS" was the requirement. Decided to plunge into CVS. SA had the CVS server installed on a Linux machine. My task was to find and explore the various CVS clients for Windows.

First, tried WinCVS. Then went on to look for CVS plugins for VS.NET. Found Jalindi Igloo. Igloo was a major failure inspite of a detailed article on the CodeProject.

Then looked into the TortoiseCVS. Inspiring integration with the windows shell. The ease of use was spell bounding. The help accompanying installation gave a detailed look into the two different methodologies for SourceControl namely, Lock-Modify-Unlock and Copy-Modify-Merge. TortoiseCVS uses C-M-M model.

A VS.NET plugin for TortoiseCVS was under development. I tried it but failed to Check out a module.

Then looked into the SubVersion alternative for CVS. Even this follows C-M-M model. But, the VS.NET plugin developed for SubVersion, ankhsvn looks good by seing the Screen Shots. Got to install svn soon and try it. The free book on subversion is excellent.

Then went on to read the Microsoft's “Team Development Guide” from Patterns&Practices. This guide is indispensible for VSS and VS.NET users.

Another Microsoft Article from MSDN was very good. This is related to SourceControl and build control for Web Projects.

For now, using WinCVS and TortoiseCVS together.

Waiting for something to happen.........

Attended MSDN Yatra! Bangalore

Yesterday, attended the MSDN Yatra's 'ASP.NET Application Security' session by MVP Srinivas Sampath.

Was a very well balanced session.

Started with the Theory of Planning an ASP.NET application for good security.

The different stages at which the security can be provided was explained with a neat diagram.

Usage of SSL was the highlight of the presentation.

Also usage of Stored Procedures instead of writing SQL in code was emphasized upon.

There were around 4 good demos.

One was how to configure IIS to enable SSL security.

The best was the Login Demo. It demonstrated a good template for authentication. Usage of Salt(Random Number), FormsAuthentication methods to store passwords safely in database.

It was followed by Authorization demo; identifying of User Roles etc.

I am going to implement these in my Application.

That's it for now.