How to not copy app.config file to output directory
I have a WPF application I am building. I am using Visual Studio Community 2015. In an effort to create a "true" release build, I am changing up some build settings so it only generates necessary fi...
- Modified
- 2 May at 14:14
How to update complex type field (json) using ormLite from servicestack
I am trying to update only one column with jsonb type. Insert works perfectly without any surprises but I can't find out how can I do update only one field with attribute [ComplextType('json')] db.Upd...
- Modified
- 27 Oct at 15:11
What does "=>" operator mean in a property in C#?
What does this code mean? ``` public bool property => method(); ```
Using ServiceStack Redis from .net core and connecting to Sentinel setup
I have created a .net core console application and included the ServiceStack.Redis.Core v1.0.23 nuget package. I also have the redis sentinel setup running locally. When I try to connect to redis usin...
- Modified
- 27 Oct at 09:55
JWT authentication for ASP.NET Web API
I'm trying to support JWT bearer token (JSON Web Token) in my web API application and I'm getting lost. I see support for .NET Core and for OWIN applications. I'm currently hosting my application in ...
- Modified
- 29 Jan at 09:57
How to publish asp.net core app Dlls without having to stop the application
When i try to publish the .net core app Dlls using ftp via filezilla tool it shows an error message that the file is in use by another process. It's understandable that the above message shows becaus...
- Modified
- 27 Oct at 07:3
How to remove all hangfire recurring jobs on startup?
I am looking at using Hangfire as a job scheduler for recurring jobs. So configuring them is simple with `AddOrUpdate`, but then how do i delete it? I don't want to pollute my code with `RecurringJob...
In .NET Framework 4.6.2 the FormattedText() is Obsoleted, how can I fix it
When I try to build the WPF project with .net framework 4.6.2, I got an error, Because the FormattedText() is Obsoleted as below: The new override method is Q: How can I determine the pixelsPerD...
- Modified
- 2 Apr at 10:26
How to set up Automapper in ASP.NET Core
I'm relatively new at .NET, and I decided to tackle .NET Core instead of learning the "old ways". I found a detailed article about [setting up AutoMapper for .NET Core here](https://lostechies.com/jim...
- Modified
- 23 Jun at 14:28
How to ignore Foreign Key Constraints in Entity Framework Core SQLite database?
Foreign Key constraint failed use SQLite with Entity Framework Core I have relations in table ``` [Table("organizations")] public class Organizations { [Column("id")] public int Id { get; se...
- Modified
- 27 Oct at 09:13
How to convert DateTime of type DateTimeKind.Unspecified to DateTime.Kind.Utc in C# (.NET)
I've inherited C# code that has an awful lot of DateTimes where the Kind property is DateTimeKind.Unspecified. These are fed into Datetime.ToUniversalTime() which gives back a UTC datetime (it adds 7...
- Modified
- 26 Oct at 21:55
swagger - annotation for permissions?
Is there any way to document the permissions required for a Request? If I have annotations like ``` [Authenticate] [RequiredRole("Admin")] [RequiredPermission("CanAccess")] public object Delete(Dele...
- Modified
- 26 Oct at 18:49
Add CSS Class to html element in a TagHelper
In an ASP.NET Core View I have the following: ``` <div class="message" message=""></div> ``` And I the a Tag Helper with the following TagHelper: ``` [HtmlTargetElement("div", Attributes = Message...
- Modified
- 12 Aug at 03:49
Why does Roslyn have two versions of syntax per language?
I have been looking at the Roslyn code base and noticed that they have two versions of syntax(One internal and one public). Often these appear to be referred to as "Red" nodes and "Green" nodes. I am ...
System.InvalidOperationException: Unable to resolve service for type
I'm working on a Web API with ASP.NET Core. When I'm executing my API with a post request, an exception is throwing before my break point in the Post method of . > Request starting HTTP/1.1 POST [h...
- Modified
- 26 Oct at 16:19
Azure Storage move blob to other container
I'm looking for an approach to move a blob in Azure from one container to another. The only solution I found is to use the Azure Storage Data Movement Library, but this seems to work between different...
Azure Functions how to add application settings to bindings
I'm trying to add some custom binding using my app settings for my Azure Function. I need to receive only string a string from my settings. [](https://i.stack.imgur.com/0M7oP.png) I would like to ge...
- Modified
- 12 Jan at 10:52
JSON.NET Serialize DateTime.MinValue as null
I'd like `DateTime` fields that are set to `DateTime.MinValue` returned by my Web API to be serialized to `NULL` instead of `"0001-01-01T00:00:00"`. I understand there's a way to get JSON.NET to om...
- Modified
- 26 Oct at 07:53
Generic function declaration in C#
I'm trying to create some stats about method call duration in a library. Instead of wrapping each method call to the library with lines to time and track it, I want to create a generic action and func...
How can I retrieve Enum from char value?
I have the following enum ``` public enum MaritalStatus { Married = 'M', Widow = 'W', Widower = 'R', Single='S' } ``` In one function I have for exp: `'S'` , and I need to have `Mar...
Create cookie with ASP.NET Core
In ASP.NET MVC 5 I had the following extension: ``` public static ActionResult Alert(this ActionResult result, String text) { HttpCookie cookie = new HttpCookie("alert") { Path = "/", Value = text...
- Modified
- 9 Sep at 16:38
Ambiguity in parameter type inference for C# lambda expressions
My question is motivated by Eric Lippert's [this blog post](https://blogs.msdn.microsoft.com/ericlippert/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five/). Consider the following code: `...
- Modified
- 25 Oct at 21:7
Unable to connect to MongoDB (MongoLabs) via C# client
I have setup in MongoLabs (mLab - [https://mlab.com/](https://mlab.com/)) a database and have added a very simple Collection. I am using the MongoDB driver to attempt to connect and work with this c...
- Modified
- 25 Oct at 19:51
Sharing a DLL between projects
Microsoft says it's platform neutral these days, so I'm trying to build on Mac and Linux only with VS Code and deploy to Azure. Why? It's mainly to prove that I can. Our project has several parts whi...
- Modified
- 11 Nov at 13:49
How to serialize a JObject the same way as an object with Json.NET?
How do I control the serialization of a JObject to string? I have some APIs that return a JObject and I usually apply some changes and persist or return them. I want to avoid persisting null properti...