1
Vote

Error from global.asax.cs when app starts

description

[HttpException (0x80004005): Request is not available in this context]
System.Web.HttpContext.get_Request() +9718944
Weapsy.Services.InstallService.GetIpAddress() in D:\Google Drive\Weapsy\Source\Libraries\Services\InstallService.cs:60
Weapsy.Services.InstallService.InstallModuleDefinition(String Name, String Description, String Title, String Controller, String Action, String AdminController, String AdminAction) in D:\Google Drive\Weapsy\Source\Libraries\Services\InstallService.cs:604
Weapsy.Services.InstallService.Initialize() in D:\Google Drive\Weapsy\Source\Libraries\Services\InstallService.cs:322
Weapsy.Services.InstallService.EnsureInstalled() in D:\Google Drive\Weapsy\Source\Libraries\Services\InstallService.cs:125
Weapsy.MvcApplication.Application_Start() in D:\Google Drive\Weapsy\Source\Web\Global.asax.cs:270

comments

lucabriguglia wrote Dec 5, 2013 at 2:51 PM

Hi irabanta,

which Weapsy version are you running?

Thanks,
Luca

irabanta wrote Dec 6, 2013 at 8:34 AM

Hello Luca,
I downloaded version 1.0 (stable).
I read the readme.txt.
I configured with IIS with .NET framework 4.
I created a sql server 2008 R2 database (Weapsy).
I changed the connectionstrings.config giving correct connection strings.

When i browse the site, I found the app creates all the tables. I also see data in Roles, Users, UserInRoles.
I dont see any user in [User] table. Then, I tried manually entering "superadmin" and "admin" in this [User] table but app throws error.

To my knowledge, "HttpContext.Current.Request" object should be NULL during Application_Start.
Since you are calling "Weapsy.Services.InstallService.GetIpAddress()" inside Application_Start, it seems that function is trying to Invoke something from "Request" object.
I will be thankful if you let me know what steps i should follow to avoid this error.

lucabriguglia wrote Dec 6, 2013 at 10:18 AM

Hi!

Yes, you are right.
The problem is in IIS 7, unfortunatly that code is quite old now.
That release is dated Jun 2012.
To avoid this error you should remove all requests to HttpContext and hardcode some replacement.
Sorry, I know is a rubbish but it's just to make the application working and test it in a faster way.
I have started to work on Weapsy again, I willl release many fixes soon.

Thanks,
Luca

irabanta wrote Dec 9, 2013 at 7:37 AM

Thanks Luca. I will wait for your next release. Please keep me informed when released.

lucabriguglia wrote Dec 9, 2013 at 8:27 AM

Hi irabanta,

if you follow the project you will receive all new release notifications.

Thanks,
Luca

irabanta wrote Dec 9, 2013 at 10:37 AM

ok thnx