Self hosting web application using Hostable Web Core
Asked Answered
H

1

6

Am trying to host a web application (aspx web form) using hostable web core feature.

Using this when i tried to load the aspx page, am getting error

error details :

responce : 502

The connection to 'localhost' failed. Error: ConnectionRefused (0x274d). System.Net.Sockets.SocketException No connection could be made because the target machine actively refused it 127.0.0.1:8080

Then i changed the CodeBehind attribute to CodeFile , after that am getting this 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.]
System.Web.HttpResponse.ApplyRedirectQueryStringIfRequired(String url) +144 System.Web.HttpResponse.Redirect(String url, Boolean endResponse) +546
System.Web.Security.FormsAuthenticationModule.OnLeave(Object source, EventArgs eventArgs) +1730
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +412 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +229

In the same application am having a test page in html format. When i tried to access that page, it's rendering properly.

Here am adding my configuration file also

AppHostAspNet.config

Hardihood answered 18/3, 2017 at 10:50 Comment(2)
hostable web core feature. Are you not planing to host in IIS? Could you elaborate more?Einstein
due to lack of ArcGIS server license, for time being we are trying to host it as a self hosting application using HWCHardihood
H
2

After some code changes and some configuration changes now it's working.

Here am attaching the working sample. Sample

In Program.cs change the code physical path

WebServer server = new WebServer( @"C:\project_path", port, siteId );
Hardihood answered 23/3, 2017 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.