Is .NET Execution Environment (DNX) similar to Mono?

Yes, DNX compares pretty well to Mono’s mono.exe. Or for that matter the runtime of other VM languages like Java (java.exe) or Python (python.exe). They all solve the same chicken-and-egg problem, they run on operating systems that don’t know beans about the VM. It has to be initialized first, the program’s entry point needs to … Read more

xUnit doesn’t write message to the output pane

This solution works for me (Visual Studio 2017 and xUnit 2.2.0.3545). Try adding the below configuration in the App.Config file. (I don’t know why. It was just needed. If it doesn’t exist, just add a new one in your test project.) <?xml version=”1.0″ encoding=”utf-8″ ?> <configuration> <appSettings> <add key=”xunit.diagnosticMessages” value=”true”/> </appSettings> </configuration> The output information will be … Read more

What are my options for sharing code between DNX / ASP.NET 5 projects (project.json / xproj) and other C# projects (csproj) within a single solution?

Take a look at what EntityFramework does. They target 3 TFMs: net45, .NETPortable,Version=v4.5,Profile=Profile7, frameworkAssemblies and they have both csproj and xproj in the same folder. Basically, for each project you have two project files. However I cannot find a way to reference ClassLibrary-dnx from WindowsService.csproj. Unfortunately, that’s not possible, yet. You can only reference csproj … Read more

RealProxy in dotnet core?

It looks like RealProxy won’t come to .NET Core/Standard. In the issue, a Microsoft developer suggests DispatchProxy as an alternative. Also, some existing AOP frameworks may support .NET Core already or in the future (as seen in the comments on the question). An alternative is the DispatchProxy, which has a wonderful example here: http://www.c-sharpcorner.com/article/aspect-oriented-programming-in-c-sharp-using-dispatchproxy/. If … Read more

Unable to resolve assembly reference issue without frameworkAssemblies

So if you squint and look at the project.json, it’s basically a nuspec with a little bit of goop to describe what compilation options and sources are needed to build to project. Nuspecs today have 2 sections, frameworkAssemblies for “built in” stuff and dependencies for other nuget dependencies. It has the same meaning here. When … Read more

How to fix DNX/DNVM in Visual Studio 2015?

This is a known issue. ASP.NET 5: On Windows 7 SP1, DNX SDK cannot be installed without Powershell 3.0. Symptoms When you create an ASP.NET 5 project, you receive the following error message: DNX SDK version ‘dnx-clr-win-x86.1.0.0-beta5’ failed to install. The solution will use DNX SDK version ‘dnx-clr-win-x86-1.0.0-beta5’ for this session Workaround To work around … Read more

Alternative solution to HostingEnvironment.QueueBackgroundWorkItem in .NET Core

As @axelheer mentioned IHostedService is the way to go in .NET Core 2.0 and above. I needed a lightweight like for like ASP.NET Core replacement for HostingEnvironment.QueueBackgroundWorkItem, so I wrote DalSoft.Hosting.BackgroundQueue which uses.NET Core’s 2.0 IHostedService. PM> Install-Package DalSoft.Hosting.BackgroundQueue In your ASP.NET Core Startup.cs: public void ConfigureServices(IServiceCollection services) { services.AddBackgroundQueue(onException:exception => { }); } To … Read more