Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot fix "Server Error in '/' Application" ServiceStack
    primarykey
    data
    text
    <p>I am having a hard time solving this issue. I am still introducing myself to ServiceStack and while trying to add a MySql Database to my web application (this could be completely unrelated to the error) I have come accross an error stopping my application from running. I have undid a lot of my steps but cannot get back to when it worked properly. Any help would be greatly appreciated.</p> <p>Error:</p> <pre><code>Method 'get_IsLocal' in type ServiceStack.WebHost.Endpoints.Extensions.HttpRequestWrapper' from assembly 'ServiceStack, Version=3.9.37.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. </code></pre> <p>Source Error:</p> <pre><code>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. </code></pre> <p>Stack Trace:</p> <pre><code>[TypeLoadException: Method 'get_IsLocal' in type 'ServiceStack.WebHost.Endpoints.Extensions.HttpRequestWrapper' from assembly 'ServiceStack, Version=3.9.37.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.] ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory.GetHandler (HttpContext context, String requestType, String url, String pathTranslated) +0 System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication. IExecutionStep.Execute() +346 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155 </code></pre> <p>My Code:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Security; using System.Web.SessionState; using ServiceStack.Configuration; using ServiceStack.OrmLite; using ServiceStack.OrmLite.MySql; using ServiceStack.ServiceInterface; using ServiceStack.ServiceInterface.Auth; using ServiceStack.ServiceInterface.Validation; using ServiceStack.FluentValidation; using ServiceStack.ServiceInterface.ServiceModel; using ServiceStack.WebHost.Endpoints; using ServiceStack.ServiceHost; using ServiceStack.Common.Utils; using ServiceStack.DataAnnotations; using ServiceStack.Common; namespace SampleHello2 { public class CustomCredentialsAuthProvider : CredentialsAuthProvider { public override bool TryAuthenticate(IServiceBase authService, string userName, string password) { //Add here your custom auth logic (database calls etc) return (userName == "Ian" &amp;&amp; password == "pass"); } public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IOAuthTokens tokens, Dictionary&lt;string, string&gt; authInfo) { //Fill the IAuthSession with data which you want to retrieve in the app eg: session.FirstName = "Ian Mc Garry"; //... //Important: You need to save the session! authService.SaveSession(session, SessionExpiry); } } public class Global : System.Web.HttpApplication { public class HelloAppHost : AppHostBase { //Tell Service Stack the name of your application and where to find your web services public HelloAppHost() : base("Hello Web Services", typeof(HelloService).Assembly) { } public override void Configure(Funq.Container container) { //Enable Features Plugins.Add(new ValidationFeature()); Plugins.Add(new AuthFeature(() =&gt; new AuthUserSession(), new IAuthProvider[] { new CustomCredentialsAuthProvider(), //HTML Form post of UserName/Password credentials } )); //register any dependencies your services use, e.g: container.RegisterValidators(typeof(HelloValidator).Assembly); //Database //string conn = "Server=host;Port=3306;Database=db;UserId=user;Password=pass;"; //container.Register&lt;IDbConnectionFactory&gt;(new OrmLiteConnectionFactory(conn, MySqlDialectProvider.Instance)); } } //Initialize your application singleton protected void Application_Start(object sender, EventArgs e) { new HelloAppHost().Init(); } } } </code></pre> <p>Again any help would be greatly appreciated. The problem is probably very clear but I cannot solve it. Also I do not have enough experience to understand the issue (error/stack trace) myself. I see it refers to the package <code>ServiceStack.WebHost.Endpoints;</code> I am using but that is all I can garner.</p> <p>Many Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload