servicestack

Hanging on “Thread.StartInternal” when handling a ServiceStack request

心不动则不痛 提交于 2019-12-10 23:32:22
问题 I have a ServiceStack (4.0.46) web service which runs fine upon launch, however after having processed a few requests and a non deterministic duration (generally between 30mn and 24 hours), it will eventually get stuck upon handling a request (which it receives well), with the following stack trace: This particular function from System.Threading.Thread seems to hang (on the last line): [SecuritySafeCritical] private void Start(ref StackCrawlMark stackMark) { this

IOC injection of IServerSideEvents

假装没事ソ 提交于 2019-12-10 22:59:21
问题 I am writing unit tests for my IOC. One of my interfaces injects IServerEvents. I am including events via: ServerEventsFeature serverEventsFeature = new ServerEventsFeature() { LimitToAuthenticatedUsers = false, NotifyChannelOfSubscriptions = false, OnConnect = (eventSubscription, dictionary) => { }, OnSubscribe = (eventSubscription) => { } }; However, container.Resolve gives the following error when debugging (Not through unit tests) : 'container.Resolve<IServerEvents>()' threw an exception

Could not load file or assembly ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43

烈酒焚心 提交于 2019-12-10 22:46:51
问题 I encountered the following error after upgrading to ServiceStack 5.0.2 Could not load file or assembly ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43 Here are the references in my project file <PackageReference Include="ServiceStack" Version="5.0.2" /> <PackageReference Include="ServiceStack.Api.Swagger" Version="5.0.2" /> <PackageReference Include="ServiceStack.Text" Version="5.0.2" /> Here are the reference seen from VS. I dont have 'ServiceStack

Getting a HttpCompileException in ServiceStack Razor view (Self hosted)

核能气质少年 提交于 2019-12-10 22:14:56
问题 ASSEMBLY 1 This is my project structure (I serve up content from embedded resources): Common_Assembly.dll Css Common.css Views Shared _Layout.cshtml This also has a class called Model.cs, which is essentially just: public class Model { public string Title {get; set; } } _Layout.cshtml @model MyNameSpace.Model <html> <head> <script language="javascript" href="css/common.css"></script> <title>@Model.Title</title> </head> <body> @RenderBody </body> </html> ASSEMBLY 2 I then have a second

stunnel https gets redirected to http

扶醉桌前 提交于 2019-12-10 21:21:35
问题 I have a Web service listening on port 8081 (it's a ServiceStack REST Web Service running on mono, if that helps). I am trying to secure it using stunnel, but the problem is as soon as I connect to https://ip, it gets redirected to http://ip:8081, which doesn't make sense to me. Could somebody point me in a direction? My stunnel config file follows: cert = stunnel.pem chroot = /usr/local/var/run/stunnel/ pid = /stunnel.pid setuid = nobody setgid = nobody foreground = yes [https] accept = 443

ServiceStack.Text serialize circular references

ⅰ亾dé卋堺 提交于 2019-12-10 19:59:38
问题 I need to serialize an object graph like this: public class A { public B Link1 {get;set;} } public class B { public A Link2 {get;set;} } So that the json only gets two instances, but is deserialized correctly again. E.g. using a meta Id or something similiar. I know that there is a way in Json.NET as described here: http://note.harajuku-tech.org/serializing-circular-references-with-jsonnet with meta ids. Is there a similiar feature in ServiceStack.Text Json Serializer? Otherwise, is it

Bypassing SSL Certificate Validation on DotNet Core Service Stack

╄→尐↘猪︶ㄣ 提交于 2019-12-10 19:24:32
问题 I know that ServicePointManager.ServerCertificateValidationCallback no longer exists in .Net Core and is instead replaced with: using(var handler = new System.Net.Http.HttpClientHandler()) { using (var httpClient = new System.Net.Http.HttpClient(handler)) { handler.ServerCertificateCustomValidationCallback = (request, cert, chain, errors) => { return true; }; } } However we are currently using the ServiceStack.Core library which, as far as I can see, does not expose either a property like

Deserialize a type containing a Dictionary property using ServiceStack JsonSerializer

孤者浪人 提交于 2019-12-10 19:13:18
问题 The code snippet below shows two ways I could achieve this. The first is using MsgPack and the second test is using ServiceStack's JSONSerializer. The second is more favourable because the ServiceStack.Text JSONSerializer is used throughout a project I'm working in. Why is the second test below failing when using a Dictionary<Street,HashSet<int>>? [TestFixture] public class NeighbourhoodTests { private Neighbourhood _myNeighbourhood; private Street _street; [SetUp] public void SetupOnEachTest

Self-hosting ServiceStack REST Service on local network

点点圈 提交于 2019-12-10 18:42:32
问题 I was wondering if anyone could help - I have a local network (wireless, my computer and a laptop connected to it) and I've tried hosting a rest service developed with ServiceStack on it. If I run the application on the computer (a console app for now) and try to access the service using the machine IP or 127.0.0.1 it works fine - but if I try and access it from the laptop, using the computer's IP it simply stalls, and the REST service is never called. I've tried turning off all firewalls etc

Response and DTO objects missing from XSD

你离开我真会死。 提交于 2019-12-10 18:12:24
问题 I'm using the latest version of ServiceStack with NuGet. I've got a basic service setup that works fine with the JsonServiceClient and is passing all of our unit tests as expected. Unfortunately I'm also trying to support SOAP and Visual Studios "Add Service Refernece" proxy generation for interop with other groups who want to continue using that sort of framework. What I'm running into is that our DTO's including the Response objects are not being populated into the XSD's or wsdl's that