ASP NET Core 2 with Full Framework

I am unable to find any documentation, or examples, of an ASP.NET MVC Core app running under the full framework. It is supposed to be supported, but as I said I cannot find any documentation of how to...

Is it possible to compile a single C# code file with the .NET Core Roslyn compiler?

In old .NET we used to be able to run the `csc` compiler to compile a single .cs file or several files. With .NET Core we have `dotnet build` that insists on having a proper project file. Is there a ...

13 Sep at 10:34

Cannot resolve DbContext in ASP.NET Core 2.0

First of all, I'm trying to seed my database with sample data. I have read that this is the way to do it (in ) (please, see [ASP.NET Core RC2 Seed Database](https://stackoverflow.com/questions/3803413...

Mongodb implications of update versus replace

I have read [this related question](https://stackoverflow.com/q/35848688/304832), but the one below is different. The mongodb c# driver has a `ReplaceOne` method (& an async counterpart) on the docume...

5 Sep at 19:11

ServiceStack CsvSerializer date format

Using CsvSerializer as a static class. All of my dates are being output with the UTC Offset: ``` 2017-09-05T01:51:52-07:00 ``` The dates being fed in are UTC, I want the offset removed, so the outp...

5 Sep at 18:47

Fluent Validation not working on Exception

After upgrading ServiceStack to 4.5.8, ServiceStack eats the exception thrown by Fluent Validation and passes validation instead of failing it whenever an exception is thrown inside the validator. Th...

5 Sep at 20:34

Why C# Arrays type IsSerializable property is True?

I was just curious why C# arrays return `true` for their `IsSerializable` property. Arrays do not have any `Serializable` attribute, and they also don't implement the `ISerializable` interface, so wh...

5 Sep at 20:23

Visual Studio 2017 - AssemblyInfo.cs not found

Today, building my solutions, this problem appear: > [Error] The file '...\ Projects \ Application \ Application \ obj \ Release \ netcoreapp2.0 \ Application.AssemblyInfo.cs' cannot be found. I've fo...

22 Nov at 20:39

Swagger not working correctly with multiple versions of ASP.NET WebApi app

Please help me with this, it looked easy at first, now I'm late in the project: I'm trying to setup API versioning for a ASP.NET WebApi project, along with Swagger. The API versioning works fine, cal...

Reference another json file in appsettings.json for ASP.NET Core configuration

In 'the old days' using XML configuration it was possible to include partial configuration from another file like [this](https://msdn.microsoft.com/nl-nl/library/ms228154(v=vs.100).aspx): ``` <appSet...

Shared projects and resource files

We have a solution with a shared project that is referenced by two other projects. In the shared project, we have `resx` files, but we noticed the code-behind `Designer.cs` file is not updated when ...

Polymorphic Model Bindable Expression Trees Resolver

I'm trying to figure out a way to structure my data so that it is model bindable. My Issue is that I have to create a query filter which can represent multiple expressions in data. For example: > x =...

Access appsettings.json from .NET 4.5.2 project

I have two projects, a 1.1.0 ASP.NET Core project and a reference to a 4.5.2 project. I want to get values from the appsettings.json file to my 4.5.2 project. The appsettings.json file is in the core...

5 Sep at 11:34

AddJsonOptions not found in ASP.NET Core 2.0

I'm migrating my ASP.NET 1.1 project to 2.0: Inside the `Setup` class, under the `Configure` method override I have: ``` services.AddMvc() .AddJsonOptions(options => options.SerializerSe...

5 Sep at 11:53

Async/await with/without awaiting (fire and forget)

I have the following code: ``` static async Task Callee() { await Task.Delay(1000); } static async Task Caller() { Callee(); // #1 fire and forget await Callee(); // #2 >1s Task.Run((...

23 Jul at 13:55

Could not load file or assembly 'System.Security.Cryptography.Algorithms, Version = 4.1.0.0

I'm trying to use System.Security.Cryptography.RNGCryptoServiceProvider class in my .NET Standard 1.4 library and according to [this](https://stackoverflow.com/questions/38632735/rngcryptoserviceprovi...

Difference in C# between different getter styles

I do sometimes see abbreviations in properties for the getter. E.g. those two types: ``` public int Number { get; } = 0 public int Number => 0; ``` Can someone please tell me if there are any diff...

5 Sep at 05:52

Packages are not compatible with netcoreapp2.0

Today this error ocurred again. Visual Studio does not recognize most of the packages instaled in Microsoft.AspNetCore.All but I'm also getting problems with: - - - The error message is like this f...

4 Sep at 23:43

C# - Body content in POST request

I need to make some api calls in C#. I'm using Web API Client from Microsoft to do that. I success to make some POST requests, but I don't know how to add the field "Body" into my requests. Any idea ?...

6 Sep at 14:45

XMLSigner No longer works in 4.6.2 - Malformed reference element

After Upgrading an application from 3.5 to 4.6.2 The following block of code no longer works. I get "Malformed reference element" Errors, even though it worked just fine as a 3.5 application. The code...

5 Sep at 13:53

EF Core - Error when adding a related entity

I get an error when I try to update a related entity of an entity that I already got from database. For illustration purposes I have these entites: ``` class Car { int Id ..; string Name ..; ...

Environment variables configuration in .NET Core

I'm using the .NET Core 1.1 in my API and am struggling with a problem: 1. I need to have two levels of configurations: appsettings.json and environment variables. 2. I want to use the DI for my con...

ASP.NET Core 2 API call is redirected (302)

I'm trying to migrate this project [https://github.com/asadsahi/AspNetCoreSpa](https://github.com/asadsahi/AspNetCoreSpa) from .net core 1.1 to 2.0 but have a problem after a successful login. After ...

Root URL's for ServiceStack and .NET Core 2

I've recently had cause to upgrade a servicestack service from .NET Core 1.1 to .NET Core 2.0. Previously, my root URL was defined in the program class a bit like this... `IWebHost host = new WebH...

How to map nested child object properties in Automapper

I have current map: ``` CreateMap<Article, ArticleModel>() .ForMember(dest => dest.BaseContentItem, opts => opts.MapFrom(src => src.BaseContentItem)) .ForMember(dest => dest.BaseContentItem.T...

31 Aug at 16:44