• About
  • Privacy Policy
  • Utilities
Darchuk.NET

.NET Core

.NET Core 3 unit testing project sdk

October 11, 2019 by Robert 6 Comments

I was following the new .NET Core 2.2 –> 3.0 upgrade document, but when I updated my unit test project files, I accidentally set the SDK to  Microsoft.NET.Sdk.Web because that’s what my ASP.NET Core 3.0 web project was. via GIPHY The unit tests still ran and worked… for the most part.  One of them failed, … [Read more…]

Posted in: .NET Core, C#, Debugging, Unit Testing Tagged: .NET Core, .NET Core 3, C#, Debugging, unit testing

.NET Core 3.0 Upgrade–New JSON Serializer Gotchas

October 4, 2019 by Robert 1 Comment

With the release of .NET Core 3.0, everyone needs to start thinking about upgrading their existing .NET Core 2.2 apps right away.  Not only because .NET Core 3.0 has a bunch of performance gains that you’ll undoubtedly want to take advantage of, but also because support for .NET Core 2.2 ends mid December.  Microsoft’s new, … [Read more…]

Posted in: .NET Core, C#, Web Development Tagged: .NET Core, Json, Serializer, Upgrade

Unit Testing Common Logging with Moq

August 30, 2019 by Robert Leave a Comment

Sometimes there’s a path in a service or application that you want to test where all it does is log something and return.  You could check other things, but sometimes it is hard to check to see if something didn’t happen… and it would be a lot easier to know if something did happen, like … [Read more…]

Posted in: .NET Core, C#, Unit Testing Tagged: .NET Core, C#, Moq, Testing, unit testing

ASP.NET Core 2.2 SignalR Server

July 12, 2019 by Robert 1 Comment

SignalR is a technology that allows you to write bi-directional communication between a server and a client.  This can lead to some pretty cool interactions, such as a live-updating dashboard on a website, or the ability to communicate requests to a server without building HTTP endpoints.  SignalR does a lot of heavy lifting behind the … [Read more…]

Posted in: .NET Core, ASP.NET, C#, SignalR, Web Development Tagged: .NET Core, ASP.NET, C#, Realtime, SignalR, Web Development

ASP.NET Core 2–Enabling SignalR logging

April 19, 2019 by Robert 1 Comment

Sometimes you just need some logging to do a sanity check that things are actually working the way that you’re expecting. via GIPHY Here’s how to turn logging on in ASP.NET Core 2 for SignalR: I’ve had to look this up more than twice, and its not exactly easy to find in the Microsoft docs, … [Read more…]

Posted in: .NET Core, ASP.NET, C#, Debugging, SignalR Tagged: .NET Core, ASP.NET, C#, Logging, SignalR

ASP.NET Core – Unit Testing a file upload

March 29, 2019 by Robert 1 Comment

Last week I wrote about how to upload a file from a website using Angular and .NET Core.  Writing tests for this is mostly straightforward, but there’s a few gotchas that I thought I would write down for the next time I need to do this.  The front end tests are pretty trivial – you … [Read more…]

Posted in: .NET Core, C#, Unit Testing, Web API, Web Development Tagged: .NET Core, ASP.NET, ASP.NET Core, File Upload, IFormCollection, IFormFile, Testing, unit testing

Uploading a file from a website

March 22, 2019 by Robert 1 Comment

Uploading a file from a website is pretty simple, but I always have to look it up.  There’s all sorts of different technologies and frameworks that work with the web, so I just thought I would write down how I got it to work so that next time I can just come back here and … [Read more…]

Posted in: .NET Core, Angular, ASP.NET, C#, JavaScript, Typescript, Web API, Web Development Tagged: .NET Core, Angular, ASP.NET, File, MemoryStream, Typescript, Upload, Web API

.NET Core WebApp–Set Port on Command Line Launch

February 22, 2019 by Robert Leave a Comment

There are a bunch of different ways to do this, but sometimes I find myself wanting to run multiple web applications locally on different ports without fussing with configuration files, etc.  And whenever I need to do this, I always have to look it up… but most of the posts out there are how to … [Read more…]

Posted in: .NET Core, ASP.NET, Web Development Tagged: .NET, .NET Core, ASP.NET, C#, WebAPI

CORS in ASP .NET Core 2.2

December 21, 2018 by Robert Leave a Comment

Recently my team upgraded to .NET Core 2.2.  We have an API that needs to be accessed from an Angular project living in a different domain, so we had CORS enabled this way: Disclaimer: this is an intranet application – so it is only accessible inside of a corporate firewall, making it more acceptable to … [Read more…]

Posted in: .NET Core, ASP.NET, C#, Security, Web API, Web Development Tagged: .NET Core, ASP.NET, C#, CORS, NETCORE, Security, WebAPI

ASP.NET MVC — Unit Testing IActionResult

April 13, 2018 by Robert Leave a Comment

In the last post I talked about using and extending IActionResult to return your preferred HttpStatus code in your ASP.NET MVC controllers.  But how do you write unit tests that make sure that you’re returning what you expect?  Your controllers will return one of these: IActionResult There’s nothing on this interface that you can easily … [Read more…]

Posted in: .NET Core, ASP.NET, C#, MVC, Unit Testing, Web API, Web Development Tagged: .NET Core, ASP.NET, C#, Controller, IActionResult, MVC, unit testing, XUnit
1 2 Next »

Recent Posts

  • Allowing trailing JSON commas in ASP.NET Core 3
  • YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha
  • Logging in a .NET Core 3 SignalR client
  • .NET Core 3 unit testing project sdk
  • .NET Core 3.0 Upgrade–New JSON Serializer Gotchas

Recent Comments

  1. Robert on C# Setting Socket Keep-Alive
  2. Oliver Schramm on C# Setting Socket Keep-Alive
  3. John Anderson on Waiting for a keypress asynchronously in a C# console app
  4. Ronald Garlit on .NET Core 3 unit testing project sdk
  5. Ronald Garlit on .NET Core 3 unit testing project sdk

Copyright © 2025 Darchuk.NET.

Omega WordPress Theme by ThemeHall