Securing a SPA by authorization server before first load

I am using the 'new' project templates for angular SPA applications in dotnet core 2.1 as written in the article [Use the Angular project template with ASP.NET Core](https://learn.microsoft.com/en-us/...

8 May at 04:37

How to set up unit tests in Unity and fix missing assembly reference error?

I created the following structure: ``` ├── Assets ├── Scenes ├── Scripts │ └── MyExample.cs ├── Tests │ ├── MyExampleTest.cs │ └── Tests.asmdef ``` Now, when I click on Run All, in the Test R...

8 May at 18:6

ASPNetCore - Uploading a file through REST

I am using Insomnia for testing an API, but the same happens with Postman. I want to test a file upload, with the following controller: ``` public async Task<IActionResult> Post([FromForm]IFormFile ...

27 Nov at 19:1

Asp.net Core 2.0 RequestSizeLimit attribute not working

I'm creating a website in Asp.net core 2.0 which allows files to be uploaded. I quickly came across the problem of the `30MB` upload limit and receive a `404` response from the server. Below this li...

7 May at 19:36

C# 7.3 Enum constraint: Why can't I use the enum keyword?

To constrain a generic type parameter to be of an enum type, I previously constrained them like this, which was the best I could go for constraining type T for enums in pre-C# 7.3: ``` void DoSomethin...

21 Oct at 18:16

Get Icon from UWP App

I want to extract the icon of an UWP App to build a Explorer like "Open With" menue. With the help of [SHAssocEnumHandlers](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762109(v=vs.85)....

7 May at 15:9

Error-Attempt by method 'X.set_DbConnection(System.Data.Common.DbConnection)' to access method 'Y.get_Settings()' failed

I created a console app and use EntityFramework 6.2 (for connection with MS SQL), MySql.Data 8.0.11 and MySql.Data.Entity 6.10.7 (for connection with MySQL). In this application I want to create a jo...

Web API 2 - Implementing a PATCH

I currently have a Web API that implements a RESTFul API. The model for my API looks like this: ``` public class Member { public string FirstName { get; set; } public string LastName { get; se...

How to make GET request with a complex object?

I try to make `GET` request via WebApi with complex object. Request is like this: Where `CustomObject` is: How do I compose a valid GET request?

6 May at 18:45

Process.WaitForExit hangs even without using RedirectStandardError/RedirectStandardOutput

We have a service which starts a process and waits for process to exit when service is stopped/ user of service calls stop (to stop/kill process started by service). Sporadically, `process.waitForExi...

18 Sep at 08:28

What is the difference between MockBehavior.Loose and MockBehavior.Strict in SimpleStub?

I'm a fresh man in VS Unit Test, and I'm learning to add mock module into my unit test project with the `SampleStub` Framework. And I now meet the trouble in understanding `MockBehavior.Loose` and ...

3 May at 07:41

Swashbuckle/Swagger + ASP.Net Core: "Failed to load API definition"

I develop an ASP.NET Core 2 application and included Swagger. Everything worked fine until I introduced a method without explicitly defining the HTTP action: ``` public class ErrorController : Control...

20 Jun at 09:12

Default proxy in .net core 2.0

I saw couple of questions asked about core 2.0 on how to make HttpClient to use default proxy configured on the system. But no where found right answer. Posting this question hoping someone who might ...

29 May at 07:31

How to validate a JWT token

I'm trying to use JWT tokens. I managed to generate a valid `JWTTokenString` and validated it on the [JWT debugger](https://jwt.io/) but I'm having an impossible time validating the token in .Net. He...

6 May at 21:49

C# how to mock Configuration.GetSection("foo:bar").Get<List<string>>()

I have a list like following in config.json file ` ``` { "foo": { "bar": [ "1", "2", "3" ] } }` ``` I am able to get the list at run-time using ``` Configuration.Get...

6 May at 16:34

.NET Core IServiceScopeFactory.CreateScope() vs IServiceProvider.CreateScope() extension

My understanding is that when using the built in the dependency injection, a .NET Core console app will require you to create and manage all scopes yourself whereas a ASP.NET Core app will create and ...

What does "+" mean in reflected FullName and '*' after Member c#

I'm currently dealing with reflection in c#. After: ``` Assembly.LoadFile(@"C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.7\System.Numerics.Vectors.dll").GetTypes() ``` And i found this:...

7 May at 16:19

ServiceStack.Text Disposes Input Stream

When deserializing data from a stream ServiceStack.Text closes the input stream. Since there is no issue tracker at Github and their web site refers to SO I post the question here. A call to ``` Jso...

5 May at 21:49

How to make lazy-loading work with EF Core 2.1.0 and proxies

I have the following models: ``` public class Session { public int SessionID { get; set; } public int UserID { get; set; } public virtual User User { get; set; } } public class User { ...

Change or rename a column name without losing data with Entity Framework Core 2.0

I realised that I had spelt one of my column headers incorrectly so I changed it in the model and created a new migration to update it into the database. All worked perfectly until I realised that wha...

How can I resolve ServiceStack Framework/Core conflicts when I am only using the Core version of ServiceStack components

I am using Visual Studio 2017. I have a Framework 4.6.1 console application referencing ServiceStack.Client.Core v5.1.0. It also references four other Standard 2.0 DLL projects in the same solution, a...

4 May at 17:47

NullReferenceException inside .NET code of SqlConnection.CacheConnectionStringProperties()

I'm facing really strange issue. Given the code below: ``` static void Main() { var c = new System.Data.SqlClient.SqlConnection(); c.ConnectionString = "Data Source=SOME_NAME;Initial Catalog...

7 May at 08:20

Entity Framework Core connect to MSSQL database over SSH tunnel

I've seen a lot of posts asking similar questions, but none of which solved the issue I have. My setup is as follows: - `127.0.0.1:1433`- `L5000 -> 127.0.0.1:1433` When I enter the server name `127...

xUnit Theory with async MemberData

I have a unit test project using [xUnit.net](http://xunit.github.io/docs/getting-started-dotnet-core) v.2.3.1 for my ASP.NET Core 2.0 web app. My test should focus on testing a given DataEntry instan...

Why do Service Stack dot net core project templates include a types folder in the service model project with a .GitIgnore

I cannot figure out, nor can I find documentation, for the use of the "Types" folder in the ServiceModel project. I have used the Service Stack project template cli for .NET Core 2.0 web and self host...

3 May at 13:25