How can I deploy a C# console application as a single exe?
I have searched for this and there are a number of previous answers but all seem overly complex. I'm new to C# and Windows development in general (previous Mac developer). I have written a simple ...
- Modified
- 11 Nov at 10:17
Testing Exception Messages with Shouldly
Is there a way to test the exception messages with shouldly? An example: ``` public class MyException: Exception{ } ``` The method to be tested: ``` public class ClassUnderTest { public void...
Change flow of messages in Microsoft Bot Framework
Hello I'm new to Microsoft Bot Framework and I have a question that I couldn't find an answer to. I have a FormFlow that ask the user for some question, after a specific question I want the bot to do ...
- Modified
- 11 Nov at 21:5
iText7 Create PDF in memory instead of physical file
How do one create PDF in memorystream instead of physical file using itext7? I have no idea how to do it in the latest version, any help? I tried the following code, but pdfSM is not properly populat...
Mocking Task.Delay
I have a method with the following line: `await Task.Delay(waitTime).ConfigureAwait(false);` I there a good strategy to avoid actually waiting the few seconds when unit testing and instead verify tha...
- Modified
- 10 Nov at 22:16
Ensure deferred execution will be executed only once or else
I ran into a weird issue and I'm wondering what I should do about it. I have this class that return a `IEnumerable<MyClass>` and it is a deferred execution. Right now, there are two possible consumers...
- Modified
- 20 Jun at 09:12
Web API 2 routing - Route attribute
Question is regarding defining custom routes with the `Route` attribute. I know that in the `WebApiConfig` class you always define the default route, ``` configuration.Routes.MapHttpRoute("API Default...
- Modified
- 7 Feb at 17:46
How to extend IdentityUser with custom property
I'm using asp.net Identity 2.0 for users to log into my website, where the authentication details are stored in an SQL database. Asp.net Identity has been implemented in a standard way as can be found...
- Modified
- 29 Aug at 14:30
How can I support the Redis sentinel architecture using StackExchange.Redis?
My application uses the `StackExchange.Redis` package and I started using the sentinel architecture in order to support high availability and failures. I've search the web, trying to find the correct...
- Modified
- 10 Nov at 16:48
The AuthorizationPolicy named: 'Admin' was not found
I am learning Authentication/Authorization in .NET Core MVC. I am trying to create a controller that can only be accessed by 'Admin', but get the following error. > An unhandled exception occurred ...
- Modified
- 11 Aug at 18:47
Is it possible to catch net::ERR_BLOCKED_BY_CLIENT?
So on our site we have various searches some of which work fine and return the appropriate results. A few of them however return the javascript error: > Failed to load resource: net::ERR_BLOCKED_BY_C...
- Modified
- 23 May at 12:6
How to configure AppHostBase virtual methods?
AppHostBase has two overridable methods where you can configure your inherited Application host - `Init()`- `Configure(Container container)` Is there a rule to know which is better? For instance: ...
- Modified
- 10 Nov at 10:8
ASP.Net Core: X-Frame-Options strange behavior
I need to remove `X-Frame-Options: SAMEORIGIN` header from some of my actions which should render a content for an iframe. As long as it is added to requests by default I disabled it in `Startup.cs`: ...
- Modified
- 27 Nov at 01:31
Hangfire DisableConcurrentExecution: What happens when the timeout expires?
Per the [Hangfire 0.8.2 announcement post](http://hangfire.io/blog/2014/05/21/hangfire-0.8.2-released.html), Hangfire has a `DisableConcurrentExecution` filter which, when applied to a method, prevent...
Can't find project classes/methods in test project
In my namespace `Draughts` I have two projects, `Draughts` and `Draughts.UnitTests`. When I try to access `Draughts` methods/classes in `Draughts.UnitTests` it can't find anything at all. At the top o...
- Modified
- 9 Nov at 20:36
How to publish messages asynchronously to MSMQ in .NET Core?
There doesn't seem to be a client available, or maybe I'm just looking in the wrong namespace. How is this expected to be done, or is the answer that I have to find another message service?
Difference between .Net Core, Portable, Standard, Compact, UWP, and PCL?
I've heard of - - - - - - All of these were explained to me as . So my questions are 1. What's the difference!? 2. If I want to write a library that's usable to as large an audience as possible,...
- Modified
- 15 Feb at 20:15
ServiceStack Message Filtering
I have been using the ServiceStack MQ Server/Client to empower a message based architecture in my platform and it has been working flawlessly. I am now trying to do something that I do not believe is ...
- Modified
- 9 Nov at 17:29
Getting property attributes in TagHelpers in ASP .NET Core
Some of model properties has "Required" data annotation, that I need to read in a TagHelper class. In the sales view I create a custom select for customer: And in the CustomerTagHelper class there is ...
- Modified
- 6 May at 18:51
What is the difference between an orm and ADO.net?
I am reading a book and it says : "if you will create your own data access layer by using ADO.NET for access into you database, you will be minimally affected whether the data schema exists or not. I...
- Modified
- 9 Nov at 11:53
Control lifetime of .NET Core console application hosted in docker
Disclaimer - this is almost the same question as [docker container exits immediately even with Console.ReadLine() in a .net core console application](https://stackoverflow.com/q/38549006/685341) - but...
- Modified
- 23 May at 11:47
Why am I unable to debug a dynamically loaded assembly?
I am working on a Web API project that uses an in-house mocking framework that allows to intercept and modify the responses from the controllers. It uses MEF to loading an assembly that contains code ...
- Modified
- 9 Nov at 15:0
How EXACTLY can += and -= operators be interpreted?
What exactly (under the hood) do the `+=` and `-=` operators do? Or are they implicit in that they are defined per type? I've used them extensively, it's a very simple feature of the syntax, but I'v...
.NET WebSockets forcibly closed despite keep-alive and activity on the connection
We have written a simple WebSocket client using System.Net.WebSockets. The KeepAliveInterval on the ClientWebSocket is set to 30 seconds. The connection is opened successfully and traffic flows as ex...