asp.net core A second operation started on this context before a previous operation completed
I have an ASP.Net Core 2 Web application. I'm trying to create a custom routing Middleware, so I can get the routes from a database. In `ConfigureServices()` I have: ``` services.AddDbContext<DbContex...
- Modified
- 13 May at 15:58
Creating a Scriptable Object in the Unity Editor
So apparently i suck at listening at my university, because i can't figure this out, not even with google... How do you create a scriptable object in the editor? I have the project open, it looks like...
Reading appsettings.json from .net standard library
i have started a new RESTful project using .NET Core Framework. I divided my solution in two parts: Framework (set of .NET standard libraries) and Web (RESTful project). With Framework folder i prov...
- Modified
- 28 May at 09:11
Multiple Dtos for same entity
Is it a good practice to use multiple DTO's for same entity in different API endpoints. For example: I have a api endpoint which accpets the following Dto: ``` public class AddressDto { public st...
- Modified
- 18 Nov at 14:19
How to run dotnet core app from command line?
I created a CLI tool using dotnet core framwork and I want to run it form the console as: I run it now by going to the location where the dll file is by uing: Can anyone help me install my application...
- Modified
- 28 Aug at 09:19
How to connect to a MySQL Database without SSL
I'm trying to connect to a local MySQL DB. I have this connector: ``` using(MySqlConnection conn = new MySqlConnection("Database=Studentenverwaltung;Port=3306;Data Source=127.0.0.1;User Id=root;Pas...
- Modified
- 23 Jan at 10:36
OpenIdConnectProtocolValidationContext.Nonce was null
HI can someone please help imgetting below error when calling outlook rest api IDX21323: RequireNonce is '[PII is hidden by default. Set the 'ShowPII' flag in IdentityModelEventSource.cs to true to r...
- Modified
- 25 May at 21:41
Programmatically turn on/off Action Center
Is there a way to programmatically turn on/off the Action Center? Additionally, I'd like to know if there is a way to programmatically turn on/off specific notifications? In manufacturing we use a b...
- Modified
- 25 May at 14:23
Aggregate $lookup with C#
I have the following MongoDb query working: ``` db.Entity.aggregate( [ { "$match":{"Id": "12345"} }, { "$lookup": { "from": "OtherC...
- Modified
- 26 May at 06:39
EF Core Migrations with multiple DbContexts on single database
I have an issue attempting to use Migrations in a ASP.NET Core solution using EF Core where there are multiple `DbContext` that share the same SQL database. In my application startup method I'm getti...
- Modified
- 25 May at 10:30
How to mock rows in a Excel VSTO plugin?
I am trying to put a mocked `Range` (which contains cells with values) inside the rows of a new `Range`. But when I try to access a specific element from the `Range`, a exception is thrown. I've trie...
- Modified
- 1 Jun at 22:12
Issue Moq'ing HttpResponseMessage
I have the following Method: ``` public async Task<SecurityRoleDeleteResult> DeleteSecurityRoleByRoleId(int securityRoleId) { string url = $"{_housingDataSecurityConfiguration.HousingDataSecurity...
- Modified
- 25 May at 09:45
How to register two implementations then get one in .Net Core dependency injection
I have parts of my code which depend on more than one implementation of the same interface, and other parts which depend on one of the implementations. I am registering implementations like: ``` ser...
- Modified
- 29 May at 10:14
Error:An unknown error occurred while invoking the service metadata component. Failed to generate service reference
When trying to use .net core 2.1 rc1 to add a service reference for WCF, I am experiencing the following error: ``` Error:An unknown error occurred while invoking the service metadata component. Fai...
UWP VisualTreeHelper.GetParent() returns null
I have a `ContentDialog` which has a `ListView`. This `ListView's` DataTemplate Contains a `Grid` and this `Grid` has a `Button`. The code goes like this: ``` <ContentDialog x:Name="DownloadListDialo...
Updating .NET framework resulting in SQL timeouts
We have an app which targets .NET 4.5.1, and this has remained unchanged. However when we upgraded the .NET framework on the server from 4.5.1 -> 4.7.1, we started experiencing SQL timeouts several h...
- Modified
- 29 May at 08:47
Authentication in WebApi with AllowAnonymous attribute
I have implemented a JWT-based authentication by inheriting `DelegatingHandler` and adding the class as `configuration.MessageHandlers.Add(new MyDelegatingHandler())`. When implementing `DelegatingHan...
- Modified
- 22 May at 04:20
Cannot create commands from unopened database
I've searched around quite a lot and I cannot find any answers to this. I am writing a Xamarin Forms Mobile application, it seems when I minimise the application and then reopen it or one of my activ...
- Modified
- 30 May at 19:59
How to set NLog max file size?
Is there any option/configuration in `NLog` to set the max log file size (for example 5MB)? What I need is, that when the log file exceeds the max size (which I define), It will backup the old one (w...
C# Clearing list before nulling
Today I have seen a piece of code that first seemed odd to me at first glance and made me reconsider. Here is a shortened version of the code: ``` if(list != null){ list.Clear(); list = null;...
- Modified
- 24 May at 03:46
Caching an HttpResult/memorystream using newer CacheControl attribute
I just discovered the new CacheControl Attribute and it's working well for standard POCOs - I was wondering if something different was required to cache a service that returned an HttpResult as a PDF....
- Modified
- 23 May at 18:20
WinForms TreeView checking/unchecking hierarchy
The following code is intended to recursively check or un-check parent or child nodes as required. [](https://i.stack.imgur.com/EZ1wZ.png) For instance, at this position, , , , and nodes must be un...
How can I use SQL Server JSON_VALUE function in EF 6 Code First for classic .NET
How can I use SQL Server JSON_VALUE function in EF 6 Code First for classic .NET? I found I can do it in like this: ``` public static class JsonExtensions { public static string JsonValue(string...
- Modified
- 15 Nov at 08:46
Why can't a C# struct method return a reference to a field, but a non-member method can?
Here's an example of an instance method of struct attempting to return a readonly ref to an instance field of the struct: ``` struct Foo { internal int _x; public ref readonly int MemberGetX...
- Modified
- 23 May at 14:43
ServiceStack AutoQuery join use
After reading the documentation, I am not sure but I have come to the conclusion that when creating QueryDb, you cannot choose the columns to join by? And I am under the impression, you must have DTO ...
- Modified
- 29 May at 19:24