Date support in d.ts for servicestack typescript client
By default servicestack typescript file dtos.ts generated by webstorm plugin makes all date properties as string. ``` // @Required() to: string; ``` in servicestack .cs file this property is DateTi...
- Modified
- 30 May at 10:3
Returning a string which contains some JSON object from ServiceStack
I have the following DTO: ``` public class MyDTO { public int Id { get; set; } public String Info { get; set; } } ``` The element contains some serialized JSON object which can be of mult...
- Modified
- 30 May at 11:35
Divide by zero and no error?
Just threw together a simple test, not for any particular reason other than I like to try to have tests for all my methods even though this one is quite straightforward, or so I thought. ``` [TestMet...
- Modified
- 27 Apr at 20:9
.NetCore JwtBearerAuthentication not rejecting expired tokens
I am generating JWT's to use with my WebApi project. I'm set the token to expire in one minute so that I can test if it rejects the token when submitted after the expiration date. ``` public async...
- Modified
- 27 Aug at 11:47
VS 2017 Metadata file '.dll could not be found
I know there is another question with exact the same problem, but I went trough all those answers, and none helped me. :( ([This was the question.](https://stackoverflow.com/questions/1421862/metadata...
- Modified
- 30 May at 19:23
How to create a List of ValueTuple?
Is it possible to create a list of ValueTuple in C# 7? like this: ``` List<(int example, string descrpt)> Method() { return Something; } ```
- Modified
- 30 May at 13:27
EncryptedXml DecryptDocument method error after .Net framework update
I have an old function written in 2013 that decrypt xml that was encrypted by another program. The code is realy simple ``` public static void Decrypt(XmlDocument Doc) { // Check the arg...
- Modified
- 30 May at 12:21
Build project with Microsoft.Build API
I'm trying to build a project using the classes in Microsoft.Build. The code is: ``` var project = new ProjectInstance(CS_PROJ_FILE); project.Build(); ``` However it's throwing the following excep...
Optional appsettings.local.json in (new format) visual studio project
My app uses appsettings.json for some settings. If appsettings.local.json is present, that should override appsettings.json for whatever settings it contains. So far, no problem. But I use git for ve...
- Modified
- 19 Jul at 15:21
How do I change the font color in an html table?
How do I change the font color in an html table? ``` <table> <tbody> <tr> <td> <select name="test"> <option value="Basic">Basic : $30.00 USD - yearly</option> <option value="Sustaining">Sustaining : ...
How to remove cached credentials from Git?
I ran: ``` $ git config credential.helper store ``` And then: ``` $ git push origin master ``` After pushing, I entered my credentials and they were saved. I read that they are stored in plaintext, ...
- Modified
- 22 Oct at 15:23
Antiforgery tokens are reusable
We use ASP.NET MVC's default Antiforgery technique. Recently a security company did a scan of a form and made note that they could use the same `_RequestVerificationToken` combination (cookie + hidden...
- Modified
- 29 May at 15:58
How to send authorization header with axios
How can I send an authentication header with a token via axios.js? I have tried a few things without success, for example: ``` const header = `Authorization: Bearer ${token}`; return axios.get(URLCo...
- Modified
- 29 Aug at 08:21
Http Client An existing connection was forcibly closed by the remote host
What am I doing wrong here? ``` var formContent = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("mobile_numbers", "5555555555"), new...
- Modified
- 7 Aug at 14:44
Autofac IComponentContext vs ILifetimeScope
I was passing the IContainer in a service so I read that it is not good to pass this around but instead use it only to the root of the app and pass either IComponentContext or ILifetimeScope . So I am...
- Modified
- 29 May at 10:38
What's the Kotlin equivalent of Java's String[]?
I see that Kotlin has `ByteArray, ShortArray, IntArray, CharArray, DoubleArray, FloatArray`, which are equivalent to `byte[], short[], int[],char[], double[], float[]` in Java. Now I'm wondering, is ...
Complex Join/Query with OrmLite ServiceStack
I'm having trouble to convert an EF linq Sample into OrmLite. I've got most of the query nailed, but some deep joins or subqueries is reasing some problems. ``` var q = from orderProduct in orderP...
- Modified
- 29 May at 09:39
Keep Getting "A second operation started on this context before a previous operation completed"
I keep getting the following error when I am executing my HttpPost form a second time. > InvalidOperationException: A second operation started on this context before a previous operation completed. An...
- Modified
- 7 May at 05:57
This application requires one of the following versions of .NET Framework
I am trying to migrate our application to the newer version of .NET Framework. From current version of 4.5 to 4.6.1 Reason, why we are migrating to version 4.6.1 instead of 4.7 or 4.6.2 is, that mos...
- Modified
- 29 May at 07:44
How To Overwrite A File If It Already Exists?
I'm making a music player. It has 2 forms; one is the main area where you play music. The second form has a CheckedListBox where you select the mp3s you want. When I click a button, it saves the selec...
- Modified
- 30 May at 01:42
c# method in generic class only for certain types
I'm trying to define a method on a generic class that is limited to a specific type. I have come up with this: It will work, but it looks like a code smell...it seems like there should be a way to get...
Is there a way to format the output format in .NET Core logging?
I'm using the built in logging provider for logging into the console (`Microsoft.Extensions.Logging.Console`) in a .NET Core console application. Each logging entry produces two lines in the output....
- Modified
- 28 May at 19:51
Statuscode 406 (Not Acceptable) in ASP.NET Core
REST services should provide content negotiation. This means that clients send an Accept header that contains the desired content type of the response. If the service does not support this media type,...
- Modified
- 6 Jun at 09:56
An expression tree may not contain a reference to a local function
> Error: An expression tree may not contain a reference to a local function ``` public void Initialize() { CloudStorageProperties ImageFileProperties(string fileName) => _cloudStorage.GetBlob(Clo...
S3 Bucket action doesn't apply to any resources
I'm following the instructions from [this answer](https://stackoverflow.com/a/23102551/773263) to generate the follow S3 bucket policy: ``` { "Id": "Policy1495981680273", "Version": "2012-10-17",...
- Modified
- 28 May at 14:30