开发者

Null reference on MVC 2 Server

I'm writing a MVC 2.0 app with VS2010. On my Windows 7 Ultimate 64bit machine it runs fine. On my laptop (Windows 7 Home Premium, 32bit) it is getting a null reference on Server when I call M开发者_开发技巧apPath.

        public ActionResult Index()
    {
        ContentModel content = new ContentModel();
        content.Content = ContentInterface.GetHtmlContent(Server.MapPath("~"), "Home");
        content.Ads = ContentInterface.GetPartialAds(Server.MapPath("~"), AdCount);
        content.Testimonials = ContentInterface.GetTestimonials();

        return View(content);
    }

I have installed MVC 2 via Webinstaller, I reregistered .Net 4 with IIS. I've confirmed IIS 6 WMI compatibility mode.

Any ideas?


Figured it out: permissions. I granted Full Control to IUSR and it works now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜