Basically I am working with PHP.But I have also great interest about asp.net(C#). So recently I am working on a website using Microsoft visual studio 2005 professional Edition and Microsoft SQL server 2000. Here I have to face some common errors. I am goggling about these errors and I have found that maximum developers face same problem. So I think it will very helpful for many developers if I share those errors using my blog. And also you can share your own experience which is also very helpful for us. So let’s see how it happens.
Error Message 1#
The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)
Error Description:
I’m including a c# file named Group to access the common functionality.
The C# file is included in App_Code directory and when I access the c# file using the code below it shows the error:
From a post I have found that this is just a namespace problem or a missing reference problem. So I put all the code inside a common namespace named ‘DocumentManage’ and now I am using this namespace with the help of using directive. But unfortunately it’s now showing that namespace named ‘DocumentManage’ not found. Also without any namespace if I run using inbuilt Asp.Net development server it is running. Only in IIS if I run using http://localhost/ it is showing the error.
Solution: There are some solutions which I have found from some of the post. I have also given my solution here.
#1 you must specify the namespace name if you put your c# code within a common namespace.
2# Visual Studio always puts classes in namespaces; please this is just a namespace problem or a missing reference problem. Just take a look at the error description on MSDN, it can be found here.
3# if you sure that you have put all your class file within a common namespace and you use this namespace with the help of using directive and you have no problem with reference also. Then be sure that you add your asp.net web site as an application into IIS. This was my problem. I was not adding my website as an application at IIS.So it shown this error. When add my web site as an application then all the error solve. I have shown here how to add your asp.net web application as an application.
Go to IIS Manager and convert your website as an application. That’s ok.
Error Message 2#:
The resource you are looking for does not have a handler associated with it
Error Description:
When I try to browse me website under local host I got this error message. As an example if I browse http://localhost:81/pdfdocument and I get this. But if I browse http://localhost:81/pdfdocument/default.aspx then it works!
Another interesting thing it does not find any JavaScript and CSS file also. It can only browse aspx extension file. I have given a screen shot here.
Solution:
Go to the IIS Manager and find out the handler mapping for the website and check StaticFile Handler and ensure that Static File Handler module has
Path *.*
Enabled
StaticFileModule, DefaultDocumentModule, DirectoryListingModule - Have these modules listed.
At screenshot you can see where you have to change.
You find the solution from http://forums.iis.net/p/1152947/1884387.aspx
There are two errors I have given here. I have another some errors which I will share with another post. so if you have errors and solutions please share with us. It is really helpful for us. Thanks all.