Questions

Request content decompression in ASP.Net Core

I sometimes need to post larger JSON request payloads to my ASP.Net Core Controllers. The size of the payload warrants (at least in my opinion) compressing it. Because ASP.Net Core Controllers do not ...

Owin claims - Add multiple ClaimTypes.Role

I have an application in which users can be assigned the following roles: - - - One user may have assigned two or more roles, eg. both SuperAdmin and User. My application uses claims, and therefor...

14 Mar at 16:27

Add Servicestack Reference with swiftref

I need to generate dtos with but my API doesn´t has the path like to [http://techstacks.io/types/swift](http://techstacks.io/types/swift). I added the swift server configuration [http://docs.service...

14 Mar at 16:12

Testing for exceptions in async methods

I'm a bit stuck with this code (this is a sample): ``` public async Task Fail() { await Task.Run(() => { throw new Exception(); }); } [Test] public async Task TestFail() { Action a = async (...

ASP.NET Core Middleware Passing Parameters to Controllers

I am using `ASP.NET Core Web API`, where I have Multiple independent web api projects. Before executing any of the controllers' actions, I have to check if the the logged in user is already impersonat...

How to create a valid, self-signed X509Certificate2 programmatically, not loading from file in .NET Core

What I currently do is that I use OpenSSL to generate PFX file. This is causing an unwanted dependency, especially for Windows users. So I found some examples on how to create your own certificate usi...

23 Jan at 04:6

Client is unauthorized to retrieve access tokens using this method Gmail API C#

I am getting the following error when i tried to authorize gmail api using service account > "Client is unauthorized to retrieve access tokens using this method" ``` static async Task MainAsync() ...

Docker ERROR: Error processing tar file(exit status 1): unexpected EOF

I needed space and executed: `docker rmi $(docker images -f "dangling=true" -q)` Since then I can't with docker-compose: `docker-compose build`, I get the error: `ERROR: Error processing tar file(exi...

14 Mar at 11:11

ASP.NET Core custom validation attribute localization

I'm trying to implement localization in a custom validation attribute in asp.net core 1.0. This is my simplified viewmodel: ``` public class EditPasswordViewModel { [Required(ErrorMessage = "OldP...

Azure B2C. Edit custom attribute using Azure Portal

I have created Azure B2C application in Azure Portal. I need to use only sign-in policy for this application(no sign-up). I need to create two kinds of users - `Simple User` and `Admin`. For this purp...

7 Dec at 16:48

there is no project.json, global.json ... etc on .NET Core Solution with Visual Studio 2017

I make a project by ``` File -> New -> Project -> Visual C# -> Web -> ASP.NET Core Web Application (.NET Core) -> Empty -> OK ``` But there is no solution and src directory and also no project...

23 Mar at 07:42

ASP.Net Core, detecting debugging vs. not debugging in a controller

I am writing my first ASP.Net code web app and in my controller I would like to have an `if` statement that checks to see if I am in debugging mode or not. I know in the Startup.cs file I can check `e...

5 May at 09:46

ASP.NET Core 1.1 and EF 6 exception in unmanaged code

For some reason, I'm getting a fatal error somewhere in EF 6, but this has only happened since I've converted to .NET Core 1.1. This application ran without issue on ASP.NET MVC 4. [](https://i.stack....

How to stream with ASP.NET Core

How to properly stream response in ASP.NET Core? There is a controller like this (): ``` [HttpGet("test")] public async Task GetTest() { HttpContext.Response.ContentType = "text/plain"; usin...

Is is possible to disable authentication providers for specific routes?

We're evaluating service stack v.4.5.6.0 for a Web API and we want clients to be able to authenticate using basic auth or credentials but we do not want them to be able to provide a basic auth header ...

13 Mar at 17:35

Sending custom headers in JsonServiceClient for Android?

I need to send custom headers in my android app, I'm using the servicestack plugin for android studio [http://docs.servicestack.net/java-add-servicestack-reference](http://docs.servicestack.net/java-a...

13 Mar at 17:25

Getting error : The binary operator Equal is not defined for the types 'System.Guid' and 'System.String'

This is My Expression Class ``` public static class ExpressionBuilder { private static MethodInfo containsMethod = typeof(string).GetMethod("Contains"); private static MethodInfo ...

13 Mar at 16:46

Add Legend to Seaborn point plot

I am plotting multiple dataframes as point plot using `seaborn`. Also I am plotting all the dataframes . My code takes each of the dataframe and plots it one after another on the same figure. Eac...

13 Mar at 15:53

how can i force await to continue on the same thread?

`await` does not guarantee continuation on the same task for spawned tasks: ``` private void TestButton_Click(object sender, RoutedEventArgs e) { Task.Run(async () => { Debug.WriteLin...

Change line width of lines in matplotlib pyplot legend

I would like to change the thickness/width of the line samples featured in the pyplot legend. Line width of line samples within legend are the same as the lines they represent in the plot (so if line ...

18 Jun at 09:6

Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies

I am using Visual Studio 2017 and am trying to create a .Net Standard 1.5 library and use it in a .Net 4.6.2 nUnit test project. I am getting the following error... > Could not load file or assembl...

Enabling CORS in Cloud Functions for Firebase

I'm currently learning how to use new Cloud Functions for Firebase and the problem I'm having is that I can't access the function I wrote through an AJAX request. I get the "No 'Access-Control-Allow-O...

Customize generated model names - Swagger UI

I'm trying to adjust the "displayName" of the model being used in an automatically generated Swagger definition. This will only affect the Swagger names, meaning the namespace in code would be left ...

Uncaught (in promise) TypeError: Failed to fetch and Cors error

having a problem with getting data back from database. I am trying my best to explain the problem. 1.If I leave "mode":"no-cors" inside the code below, then I can get data back from server with Postm...

12 Mar at 23:28

'Could not load file or assembly 'System.Web.Helpers' or one of its dependencies

I'm getting the follow error when trying to run my ASP.NET project. Can anyone advise? ``` Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's mani...

12 Mar at 23:4