Type not found at runtime!?


T

Trapulo

Running a Web Application I have this compilation error from ASP.NET:

Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'System.Web.Routing.IRouteHandler' is
not defined.

Source Error:

Line 47: ''' <remarks></remarks>
Line 48: Public Class ProductsRoutesHandler
Line 49: Implements System.Web.Routing.IRouteHandler
Line 50:
Line 51:


But my class is ok, and I can compile it from Visual Studio without any
problem... What can be?

This is my code:

Public Class ProductsRoutesHandler
Implements System.Web.Routing.IRouteHandler

''' <summary>
''' Maps "Products/product/{ProductID}" to "Products/product" with "ID"
in httpcontext("ProductID")
''' </summary>
''' <param name="requestContext"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetHttpHandler(ByVal requestContext As
System.Web.Routing.RequestContext) As System.Web.IHttpHandler Implements
System.Web.Routing.IRouteHandler.GetHttpHandler

Dim productID As String =
requestContext.RouteData.GetRequiredString("ProductID")

Dim virtualPath As String = "~/Products/product.aspx"

System.Web.HttpContext.Current.Items("ProductID") = productID

Return
DirectCast(System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(virtualPath, GetType(Page)), System.Web.IHttpHandler)

End Function

End Class


thanks
 
Ad

Advertisements

P

Patrice

Hello,

As this is new in 3.5 my first thought would be that the web server uses 2.0
rather than 3.5. Have you checked which version is installed in the web
server ? Upgrading is safe as 3.5 is basically 2.0 with new features.
 
A

Alexey Smirnov

T

Trapulo

Patrice said:
Hello,

As this is new in 3.5 my first thought would be that the web server uses 2.0
rather than 3.5. Have you checked which version is installed in the web
server ? Upgrading is safe as 3.5 is basically 2.0 with new features.

Hello,
I've the trouble developing in VS 2008 SP1, when I run debug using F5. And
this is a new project, but I have a lot of older project that use Routing and
work well :(
 
A

Alexey Smirnov

Hello,
I've the trouble developing in VS 2008 SP1, when I run debug using F5. And
this is a new project, but I have a lot of older project that use Routingand
work well :(

Do you see it in the list of References of the project? If not, click
Add Reference and look for 'System.Web.Routing'
 
P

Patrice

Try perhaps :
http://msdn.microsoft.com/en-us/library/cc668202.aspx

Your new project is based on which template ? (one that includes routing ?)

I would search for Routing in the web.config of a project that works and
would search Routing in the web.config of the project that doesn't work.

If you are using the proper framework version then could it be just that the
web.config file doesn't contains the needed entries ?
 
Ad

Advertisements

T

Trapulo

Alexey Smirnov said:
Do you see it in the list of References of the project? If not, click
Add Reference and look for 'System.Web.Routing'

of course.
I solved defining the "copy local=true" attribute to the reference...
However this is really strange: it's first time I need this, and assembly is
right in my GAC :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top