Null reference on MVC 2 server

I am writing an MVC 2.0 application with VS2010. On my 64-bit Windows 7 Ultimate machine, it works fine. On my laptop (Windows 7 Home Premium, 32 bit) it gets a null link on the server when I call MapPath.

        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 installed MVC 2 through Webinstaller, I re-registered .Net 4 with IIS. I have confirmed compatibility with IIS 6 WMI.

Any ideas?

+3
source share
1 answer

Found out: permissions. I have given full control of IUSR, and now it works.

0
source

Source: https://habr.com/ru/post/1768806/


All Articles