Pages

Tuesday, August 28, 2012

Visual Studio Solution Files

When a website is created using Visual Studio, it creates a solution (.sln) file and a hidden solution user options (.suo) file. These files are created under My Documents\Visual Studio[version] folder. The solution file, an XML file, consists of the following information:

• List of projects existing under the solution
• List of project dependencies
• Source control information, including Microsoft VSTF Server
• A list of associated add-ins
• Default language used by the solution

The solution user options file, a binary file, contains user project settings for the IDE and are specific to each developer. This file consists of the following information:

• The task list
• Debugger break points and watch window settings
• Visual Studio window locations

Since the solution files are Visual Studio specific and not needed for website deployment, they are not located under the website folder (although they may exist under the same folder). Also, since a solution file consists of a list of projects and websites, it is a good practice to keep them separate. In addition, different developers can have different solution file (pointing to the same list of projects) configured to their preference.

Using visual studio, we can either create a website or a web application. The former does not have an associated project file while the later does. The project file in web applications is helpful for developers who use visual studio for building applications.

Sunday, June 3, 2012

Determine the SQL Server Service Pack Installed

It can be difficult to find which Service Pack for SQL Server is installed on a machine. Neither is this information stated under SQL Server nor under Windows > Add Remove Programs. To get this information, use the following query:

SELECT SERVERPROPERTY ('productlevel')

You will get the following result (depending on the SP installed):

SP[1,2,3...]

I hope this helps. Stay tunned for more...

Monday, May 21, 2012

ASP.NET application not browsing on localhost

Recently I came across a problem where we hosted a new ASP.NET website on a freshly installed IIS (Windows 7). We were able to browse the application through the IP address. But when we tried to browse the application using the hostname or localhost, it didn't work (we reached the homepage but afterwards, all functions resulted in an asp.net error). We had the following scenario:

1. http://hostmachine/somesite (No)
2. http://localhost/somesite (No)
3. http://1.1.1.1/somesite (Yes)

After doing lots of googling (I mean binging :-), it turned out to be a potential bug where the DNS resolution didn't work for the loopback address. Microsoft claims that 127.0.0.1 is automatically resolved. But this is not the case and needs a fix. To fix this issue, go to C:\Windows\System32\drivers\etc and open the file hosts. Uncomment the following line:


# 127.0.0.1 localhost (remove #)


Now you can browse your application using localhost or hostname without any issue. I hope you find this article useful. Stay tuned for more.

Wednesday, February 1, 2012

SQL Server Indexing

In this blog, I will talk about SQL Server indexing. More to follow shortly...

Nested Master Pages

In this blog, we talk about nested master pages. Master Pages are a great way of providing a consistent look and feel throughout a asp.net website. More to follow shortly....