Site working in VS but not working on IIS



My EpiServer site is working well in Visual Studio but I tried to publish it on IIS but I get:

EpiServer 6.0 is installed on my computer.

Any help is appreciated.


Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

[No relevant source lines]

Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\92c6fb4c\87c6c133\App_Web_l0zt3bl2.0.cs    Line: 0

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Configuration.Settings.get_Instance() +28
   EPiServer.PageBase..cctor() +9

[TypeInitializationException: The type initializer for 'EPiServer.PageBase' threw an exception.]
   EPiServer.PageBase.OnPageSetup() +25
   PageTypeBuilder.UI.TemplatePage`1..ctor(Int32 enable, Int32 disable) +63
   Lidingoloppet.Default..ctor() +40
   ASP.default_aspx..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\92c6fb4c\87c6c133\App_Web_l0zt3bl2.0.cs:0
   __ASP.FastObjectFactory_app_web_l0zt3bl2.Create_ASP_default_aspx() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\92c6fb4c\87c6c133\App_Web_l0zt3bl2.3.cs:0
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +174
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +42
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +516
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Mar 12, 2014 13:08

Is ASP.NET registered with the IIS?

Mar 12, 2014 14:09

Yes it is. Other c# sites are working.

Mar 12, 2014 18:48

Check if some of the config files are not transformed to something strange during publish, also check whether all necesary files are copied over to published location. Or "try to publish in IIS" means just bind the same directory to IIS site?

Mar 13, 2014 17:44

When you say "it works in Visual Studio", is that IIS Express or Cassini (the built-in webserver)? If it works in Cassini you need to change the configuration files to get it to work on IIS 7 and later.

Here is a blog post that tells you how to get the correct configuration files

Edited, Mar 13, 2014 21:45

Yes, I mean the site works when I run it in the built-in webserver in Visual Studio. I even tried to bind IIS to the same directory but what works through VS doesn't work through IIS 7.5 and the exception is the one I posted earlier.

I'll check the blog post you referred to.

Thx Johan and Valdis.

Edited, Mar 14, 2014 13:36
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.