2017-03-18 4 views
6

Ich versuche, eine Webanwendung (Aspx-Webformular) mit Hostable Web Core-Funktion zu hosten.Self-Hosting-Webanwendung mit Hostable Web Core

diese verwenden, wenn ich versuche, die aspx-Seite zu laden, sind immer Fehler

Fehlerdetails:

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

Dann änderte ich das Codebehind Attribut Codefile, danach am Erhalte diesen Fehler:

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 der gleichen Anwendung habe ich eine Testseite im HTML-Format. Wenn ich versuchte, auf diese Seite zuzugreifen, wird sie richtig gerendert.

Hier ist Hinzufügen meiner Konfigurationsdatei auch

AppHostAspNet.config

+0

'Hostfähige Web-Kern ändern feature.' in IIS zu hosten Planen Sie nicht? Könnten Sie mehr ausarbeiten? – Win

+1

aufgrund fehlender ArcGIS-Server-Lizenz, versuchen wir derzeit, es als eine Host-Anwendung mit HWC zu hosten – thejustv

Antwort

2

Nach einigen Änderungen am Code und einige Änderungen Konfiguration arbeitet jetzt es.

Hier ist das Arbeitsbeispiel anhängen. Sample

In Program.cs den physischen Codepfad

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