简体   繁体   中英

The type or namespace name 'Routing' does not exist in the namespace 'System.Web'

Application is based on .NET 4.0 (Property window shows the same). I am trying to implement routing in ASP.NET Webforms. I added global.asax and trying to register routes. I tried adding below line to Glabal.asax

<%@ Import Namespace="System.Web.Routing" %>

It throws an error : The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I'm not missing an assembly reference. I added reference to system.web(4.0) and system.web.routing(4.0) as well. Its still not working.

I don't know what is wrong here. Any help is appreciated

Simply add the reference from Assemblies:

在此处输入图片说明

As @Fred indicated, please see Which NuGet package contains System.Web.Routing?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM