servicestack-bsd

404 Not Found error when running ServiceStack on IIS8

a 夏天 提交于 2020-01-24 08:15:27
问题 My ServiceStack web service works fine in IIS Express (VS 2012) and when deployed to Windows Azure, but it does not work under IIS 8 on Window 8. I am getting 404 Not Found Error . My web.config has both sections defined for IIS Express and the web server. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.5"> <assemblies> <add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /

404 Not Found error when running ServiceStack on IIS8

强颜欢笑 提交于 2020-01-24 08:12:19
问题 My ServiceStack web service works fine in IIS Express (VS 2012) and when deployed to Windows Azure, but it does not work under IIS 8 on Window 8. I am getting 404 Not Found Error . My web.config has both sections defined for IIS Express and the web server. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.5"> <assemblies> <add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /

How to change sql server connection string dynamically in service stack

↘锁芯ラ 提交于 2019-12-25 06:37:48
问题 I am working on Asp.Net MVC and ServiceStack. I am trying to connect to the sql server database using servicestack ormlite. like var connectionString = ConfigurationManager.ConnectionStrings["AppDb"].ConnectionString; container.Register<IDbConnectionFactory>( new OrmLiteConnectionFactory(connectionString, SqlServerOrmLiteDialectProvider.Instance) { ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current) }); I am able to connect to database, But in my scenario i need to change

ServiceStack.OrmLite equivalent of Single/SingleOrDefault from Entity Framework

谁说我不能喝 提交于 2019-12-12 05:28:14
问题 Currently when using OrmLite library from ServiceStack if I want single entity selected I do: AppUser user = db.First<AppUser>(q => q.Id == id); However since Single is more precise (obviously I want exception thrown if somehow multiple users with same id ended up in database) I was wondering if there is overload that I can use. Currently when I do db.Single I just get that overload with manual filtering: public static T SingleOrDefault<T>(this IDbConnection dbConn, string filter); 回答1: OK, I

ServiceStack: URL Re-writing with Self-Hosted application

江枫思渺然 提交于 2019-12-12 04:13:24
问题 I have a self-hosted application which has an index.html file at its root. When I run the application and go to localhost:8090 (app is hosted on this port) the URL looks like: http://localhost:8090/index.html . Is there anyway I can make the URL to just be: http://localhost:8090 when on the index.html page? Note I'm using V3 of ServiceStack 回答1: ServiceStack v4 In ServiceStack v4 I use a raw http handler to intercept the root. In your AppHost Configure method: public override void Configure

Is RequestFilter Validation client dependent?

跟風遠走 提交于 2019-12-11 06:23:54
问题 Should I expect Request Filter Validation (e.g. FluentValidation) to be triggered when instantiating a reference service via AppHostBase.ResolveService<> ? Thus far, I've only successfully received proper error responses to my C# application when using the typed clients (JsonServiceClient in this case specifically). 回答1: You are right. If you try use AppHostBase.ResolveService<T> it does not execute any of the registered request filters. Essentially it only resolves the Service from the

ServiceStack BSD version 3.9.71 and protobuf-net version

Deadly 提交于 2019-12-11 03:47:17
问题 I downloaded the ServiceStack BSD version 3.9.71 from Nuget using the commmands Install-Package ServiceStack -Version 3.9.71 and Install-Package ServiceStack.Plugins.ProtoBuf -Version 3.9.71 I installed also the protobuf-net Install-Package protobuf-net but I have problem because the ServiceStack 3.9.71 try to find the protobuf-net ver.2.0.0.640, when the last version of protobuf from Nuget is 2.0.0.668 回答1: The NuGet packages doesn't specify a version constraint on them so they get the

ServiceStack: Access Session info from Javascript

我只是一个虾纸丫 提交于 2019-12-11 01:55:12
问题 I'm creating a SPA using ServiceStack and AngularJs. When a user logs in I set some variables in the OnAuthenticated method: public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IOAuthTokens tokens, Dictionary<string, string> authInfo) { var sessionUser = session.TranslateTo<AppUserSession>(); var user = _userRepo.LoadUser(session.UserAuthName); var userSettings = ConfigurationSettings.Load(user); var customers = _customerRepo.ToList(); sessionUser.UserName =

Is there a build issue in the recent versions of ServiceStack 3?

99封情书 提交于 2019-12-10 12:45:32
问题 I have had the following warning show up in visual studio when compiling a project using ServiceStack 3.9.71.0 (seems to affect most recent releases too). Not sure why it hasn't shown up before but it has started showing up after I created a test lib which references my main project and both have references to the same service stack DLLs: Warning 2 Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the

ServiceStack “new” api and async await

99封情书 提交于 2019-12-07 04:47:20
问题 ServiceStack version 3 I'm quite familiar with https://github.com/ServiceStack/ServiceStack/wiki/New-API and on this page it specifically says "All these APIs have async equivalents which you can use instead, when you need to." Is it possible to use async await with ServiceStack's new api? What would the server and client code look like with async await? [Route("/reqstars")] public class AllReqstars : IReturn<List<Reqstar>> { } public class ReqstarsService : Service { public List<Reqstar> Any