I have published my site to a local version of iis7 on my windows 7 machine before publishing to web host and i'm getting the following error:
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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Web.UI.Helpers.Weather.GetWeatherCurrentForcast.data(String id) +1947
System.Threading.Tasks.Task`1.InnerInvoke() +78
System.Threading.Tasks.Task.Execute() +109
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
Web.UI.Controllers.<Index>d__3.MoveNext() +434
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
lambda_method(Closure , Task ) +57
System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +105
System.Web.Mvc.Async.<>c__DisplayClass3f.<BeginInvokeAsynchronousActionMethod>b__3e(IAsyncResult asyncResult) +22
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +124
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +838059
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +15
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +33
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +838644
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +65
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +51
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +282
How can i debug the site once running on IIS 7 to try and find why the error is occuring,
please note this error does not occur on IIS Express
Thanks
George
Made redundant and now looking to build website that i always wanted to. (I'm not a professional programmer, just teaching myself)
Well, how long is this method: Web.UI.Helpers.Weather.GetWeatherCurrentForcast.data(String id) ? Because that one seems to be the one with the problem. Is that method a method of your own making?
You could also compile your Release version with debug information and upload the PDB files to your web server (/bin directory) and that should be enough to get the line number where the error is popping up.
I seem to have narrowed the problem down to the web.config file (ihope), if i comment out all partialview etc that retrieve the data from either a database or external website it work ok, if I add a class to the web.domain project which just returns a string I
can retrieve the data.
If I add a class in the web.ui project that retrieves data from the database, it throws the error above.
So it seems the problem has something to do with the web.config, but I cannot find what the problem is.
Made redundant and now looking to build website that i always wanted to. (I'm not a professional programmer, just teaching myself)
So it works when you comment out everything that talks to your database? That is what clued me in to thinking you may have something screwy in your connection strings. How do you have your database set up right now? Is it hosted locally or on a different
server?
This gets more confusing, if I click on File > Open > Website in Visual Studio and select the website it works ok, It just seems to be a problem with IIS7
Made redundant and now looking to build website that i always wanted to. (I'm not a professional programmer, just teaching myself)
Now get this error when I try the above but select ISS
Failed to map the path '/'.
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.InvalidOperationException: Failed to map the path '/'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Failed to map the path '/'.]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +461
[HttpException (0x80004005): Failed to map the path '/'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12880068
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12721257
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034
Made redundant and now looking to build website that i always wanted to. (I'm not a professional programmer, just teaching myself)
This error is abviously because that the model you referenced here is null. Based on your description, it might caused by you didn't deploy your database correctly. Please double check it.
Regards
Please mark the replies as answers if they help or unmark if not.
Feedback to us
CareerChange
Member
43 Points
180 Posts
Debug mvc project once published to iis7 server
Feb 20, 2013 03:17 PM|LINK
Hi
I have published my site to a local version of iis7 on my windows 7 machine before publishing to web host and i'm getting the following error:
How can i debug the site once running on IIS 7 to try and find why the error is occuring, please note this error does not occur on IIS Express
Thanks
George
webJose
Member
730 Points
186 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 07:32 PM|LINK
Well, how long is this method: Web.UI.Helpers.Weather.GetWeatherCurrentForcast.data(String id) ? Because that one seems to be the one with the problem. Is that method a method of your own making?
You could also compile your Release version with debug information and upload the PDB files to your web server (/bin directory) and that should be enough to get the line number where the error is popping up.
CareerChange
Member
43 Points
180 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 10:31 PM|LINK
Hi
I seem to have narrowed the problem down to the web.config file (ihope), if i comment out all partialview etc that retrieve the data from either a database or external website it work ok, if I add a class to the web.domain project which just returns a string I can retrieve the data.
If I add a class in the web.ui project that retrieves data from the database, it throws the error above.
So it seems the problem has something to do with the web.config, but I cannot find what the problem is.
joelkronk@ho...
Member
629 Points
641 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 10:43 PM|LINK
maybe your connection strings aren't matching up correctly?
CareerChange
Member
43 Points
180 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 10:57 PM|LINK
Hi
When I run the site under ISS Express it works ok, once I publish it to IIS7 on my local machine it does not work
Thanks
joelkronk@ho...
Member
629 Points
641 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 11:09 PM|LINK
So it works when you comment out everything that talks to your database? That is what clued me in to thinking you may have something screwy in your connection strings. How do you have your database set up right now? Is it hosted locally or on a different server?
CareerChange
Member
43 Points
180 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 11:10 PM|LINK
Hi
Db on same machine as i'm using at the moment
CareerChange
Member
43 Points
180 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 11:46 PM|LINK
This gets more confusing, if I click on File > Open > Website in Visual Studio and select the website it works ok, It just seems to be a problem with IIS7
CareerChange
Member
43 Points
180 Posts
Re: Debug mvc project once published to iis7 server
Feb 20, 2013 11:50 PM|LINK
Now get this error when I try the above but select ISS
Young Yang -...
All-Star
21111 Points
1817 Posts
Microsoft
Re: Debug mvc project once published to iis7 server
Feb 27, 2013 05:07 AM|LINK
This error is abviously because that the model you referenced here is null. Based on your description, it might caused by you didn't deploy your database correctly. Please double check it.
Regards
Feedback to us
Develop and promote your apps in Windows Store