Webactivator不会在IIS上运行7 [英] Webactivator doesn't run on IIS 7

查看:175
本文介绍了Webactivator不会在IIS上运行7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个Web应用程序使用使用WebActivator包。在我的本地机器与IIS 7.5防爆preSS,一切工作正常我无论是在发布或调试配置测试。但是,我的生产机器与IIS 7.5上,WebActivator实际上并不运行,所以所有的模块加载失败,我要加上code回的Global.asax.cs文件。

我难倒到哪里,甚至开始寻找 - Google搜索和搜索计算器,但还没有跑进遇到类似问题的人。有什么明确的需要进行配置,以允许它运行?

编辑 - 激活的记录到Windows的新增快速出样。该函数的内容,当加入的Global.asax.cs文件运行在生产服务器上很好,但从来没有从激活记录。

 使用System.Web.Mvc;
使用系统;[装配:WebActivator preApplicationStartMethod(typeof运算(Admin.App_Start.WebActivatorTestStart),开始)命名空间Admin.App_Start
{
    公共静态类WebActivatorTestStart {
        公共静态无效的start(){            System.Diagnostics.EventLog登录=新System.Diagnostics.EventLog();
            log.Source =.NET运行库;
            log.WriteEntry(WebActivator开始,System.Diagnostics.EventLogEntryType.Information);        }
    }
}


解决方案

好吧,我不能肯定地说我做了什么解决的事情,但它的工作现在。

一点点历史回顾 - 我管理大量使用一些公共库不同的大型应用程序的所有。我有我的常见的网络图书馆,这就是我曾经有过国际奥委会与设置和Ninject WebActivator。该基地库它有App_Start文件夹。也许这是什么原因呢?说不上来。从来没有WebActivator与此安装程序工作,所以我只是用NinjectHttpApplication办理登记和启动的东西。但是,基本库还对WebActivator(只是没有App_Start文件夹)的依赖关系。

所以,现在我正在重构了一些应用程序和基础库的 - 从过去几个月的清理一堆code气味。其中一个步骤是将所有的IoC到实际的Web应用程序 - 制造基地库少铁板一块。基础磁带库不再对WebActivator任何依赖。

和现在的作品。我的基本库做,所以我道歉,别人不是更系统的关于它也有一个半其他一百的微小变化。

I have several web applications that make use of packages using WebActivator. On my local machine with IIS 7.5 Express, everything works fine whether I test in Release or Debug configurations. However, on my production machine with IIS 7.5, WebActivator doesn't actually run, so all the modules fail to load and I have to add the code back into the Global.asax.cs file.

I'm stumped as to where to even begin looking - Googled and searched StackOverflow but haven't ran into anyone having similar issues. Is there anything explicit that needs to be configured to allow it to run?

Edit - Added quick sample of activator that logs to Windows. The function contents, when added to the Global.asax.cs file runs fine on the production server, but never logs from the activator.

using System.Web.Mvc;
using System;

[assembly: WebActivator.PreApplicationStartMethod(typeof(Admin.App_Start.WebActivatorTestStart), "Start")]

namespace Admin.App_Start
{
    public static class WebActivatorTestStart {
        public static void Start() {

            System.Diagnostics.EventLog log = new System.Diagnostics.EventLog();
            log.Source = ".NET Runtime";
            log.WriteEntry("WebActivator Start", System.Diagnostics.EventLogEntryType.Information);

        }
    }
}

解决方案

Well, I can't say for sure what I did to fix things, but it's working now.

A bit of history - I manage a number different large applications all using some common libraries. I have my common web library and that's where I used to have the IOC setup with Ninject and WebActivator. This base library had the App_Start folder in it. Maybe this was the reason? Dunno. Never got WebActivator to work with this setup so I just used the NinjectHttpApplication to handle registration and startup stuff. However, the base library still had a dependency on WebActivator (just no App_Start folder).

So now I'm working on refactoring some of the applications and the base libraries - clean up a bunch of code smell from the past few months. One step was to move all the IoC up to the actual web application - make the base libraries less monolithic. The base library no longer has any dependency on WebActivator.

And now it works. There also half a hundred other small changes I've made to the base library, so I apologize to others for not being more systematic about it.

这篇关于Webactivator不会在IIS上运行7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆