实现 URLRewriter.Net 会出现引用异常

发布于 2024-10-02 17:28:46 字数 1960 浏览 3 评论 0原文

按照此处的说明操作后

如何要使用 UrlRewriter.Net 实现 URL 重写?

我收到引用异常 -->


“/”应用程序中的服务器错误。

你调用的对象是空的。 [NullReferenceException:未将对象引用设置为对象的实例。] Intelligencia.UrlRewriter.Configuration.RewriterConfiguration.Load() +109 Intelligencia.UrlRewriter.Configuration.RewriterConfiguration.get_Current() +216 Intelligencia.UrlRewriter.RewriterHttpModule..cctor() +47

[TypeInitializationException:“Intelligencia.UrlRewriter.RewriterHttpModule”的类型初始值设定项引发了异常。]

[TargetInitationException:调用目标已引发异常。] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(布尔publicOnly,布尔fillCache)+86 System.RuntimeType.CreateInstanceImpl(布尔publicOnly,布尔skipVisibilityChecks,布尔fillCache)+230 System.Activator.CreateInstance(类型类型,布尔非公共)+67 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,活页夹活页夹,对象[]参数,CultureInfo文化,对象[]激活属性)+1051 System.Activator.CreateInstance(类型类型,BindingFlags bindingAttr,活页夹活页夹,对象[] args,CultureInfo文化,对象[]activationAttributes)+111 System.Web.Configuration.Common.ModulesEntry.Create() +39 System.Web.Configuration.HttpModulesSection.CreateModules() +164 System.Web.HttpApplication.InitModules() +28 System.Web.HttpApplication.InitInternal(HttpContext上下文,HttpApplicationState状态,MethodInfo []处理程序)+729 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext上下文)+298 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107

System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289

我添加了标签,因为我已经读到,当您没有添加标签时,大多数时候都会弹出此错误web.config 中指定的重写器部分。 那么现在可能出现什么问题呢? 我试图在 IIS 6.0 (windows 2003) 服务器上运行它。

After following the instructions here

How To Implement URL rewriting with UrlRewriter.Net?

I'm getting a Referenece Exception -->


Server Error in '/' Application.

Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
Intelligencia.UrlRewriter.Configuration.RewriterConfiguration.Load() +109
Intelligencia.UrlRewriter.Configuration.RewriterConfiguration.get_Current() +216
Intelligencia.UrlRewriter.RewriterHttpModule..cctor() +47

[TypeInitializationException: The type initializer for 'Intelligencia.UrlRewriter.RewriterHttpModule' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Web.Configuration.Common.ModulesEntry.Create() +39
System.Web.Configuration.HttpModulesSection.CreateModules() +164
System.Web.HttpApplication.InitModules() +28
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107

System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289

I have added the tag because I have read that this error most of the times pops up when you don't have the rewriter section specified in your web.config.
So what can be the problem now?
I'm trying to run this on an IIS 6.0 (windows 2003) server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绿萝 2024-10-09 17:28:46

该模块无法在 IIS 6.0 上运行,因为 URLRewrite 模块 2.0 仅可作为 IIS 7.0 的扩展。

This module won't be able to run on IIS 6.0 since the URLRewrite module 2.0 is only available for IIS 7.0 as an extension.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文