A standalone web application using Hostable Web Core

I am trying to host a web application (aspx web form) using the web core function with the host.

Using this when I tried to load an aspx page, I get an error

error info:

Answer: 502

Failed to connect to "localhost". Error: ConnectionRefused (0x274d). System.Net.Sockets.SocketException. The connection could not be because the target machine actively refused it 127.0.0.1:8080

Then I changed the CodeBehind attribute to CodeFile , after which I get this error:

The reference to the object is not installed in the instance of the object.

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

Exception Details: System.NullReferenceException: object reference not installed on the object instance.

Source Error:

An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of the exception can be identified using the exception stack trace below.

Stack trace:

[NullReferenceException: ​​ .]
System.Web.HttpResponse.ApplyRedirectQueryStringIfRequired(String url) +144 System.Web.HttpResponse.Redirect(String url, Boolean endResponse) +546
System.Web.Security.FormsAuthenticationModule.OnLeave( , EventArgs eventArgs) +1730
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +412 System.Web.HttpApplication.ExecuteStep( IExecutionStep, Boolean & ) +229

am html. , .

AppHostAspNet.config

+6
1

, .

.

Program.cs

WebServer server = new WebServer( @"C:\project_path", port, siteId );
+2

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


All Articles