Thursday, July 9, 2020

Copying files ignoring errors on Windows

When copying a directory between Linux and Windows a lot of errors might be thrown, so I like to use this command to silent and ignore the errors:

xcopy $SOURCE $DESTINATION /C /E /Q 

Wednesday, July 8, 2020

Talks 2 Code Conference

 Check out my talk for the magazine Software Guru. It's in Spanish though.


https://youtu.be/DyotAYEa5AU



Wednesday, July 1, 2020

WslRegisterDistribution failed with error: 0xffffffff

While setting up WSL2 I came across this error. This seems like a scary error "WslRegisterDistribution failed with error: 0xffffffff", but all it means is port 53 is taken. 

The solution for me was to run this in cmd:
netstat -aon | findstr ":53"

And then find the PID that was using port 53, go to the task manager and kill it.

I also stopped the Docker services just in case (in the Windows "Services" UI).

Friday, June 26, 2020

React native error: EPERM: operation not permitted, lstat signing-config.json

So I started working with React native. While setting up a project in Visual Studio Code, this error came up. What ended up fixing the error is deleting the file "android/app/build/intermediates/signing_config/debug/out/signing-config.json".

Monday, May 25, 2020

Bind a list of non-sequential indexes

I recently discovered a bug in an application. There was a list of items in a form, each with an index (0, 1, 2, 3...) and if I removed item 2 only items 0 and 1 would get posted.

This seemed to me a rather common problem and something more people would have encountered by now. Luckily, I came across this post from 2008 by Phil Haack (https://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx/) in which he basically says we need a hidden input with the Index suffix for each item we need to bind to the list.

And guess what? It works!!

Saturday, April 18, 2020

Upgrade to .NET Core 3.1 - Could not load file or assembly Microsoft.IntelliTrace.Core

The last error I came across was this one, "Could not load file or assembly Microsoft.IntelliTrace.Core". This happened while debugging a test.

The initial fix was upgrading the referenced nuget packages to their latest version. However, after this, I still got the error. The solution was to update Visual Studio 2019 to it's latest version. Not very intuitive, but it worked.

Friday, April 17, 2020

Upgrade to .NET Core 3.1 - Using StructureMap in .NET 3.1

In short, you should stop using StructureMap. It's no longer supported. Instead, use Lamar, and only have to make minimal changes. It's written by the same guy who wrote StructureMap.

In your Program.cs:

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .UseLamar()
                .ConfigureWebHostDefaults(webBuilder =>
                {

In your Startup.cs:

        public void ConfigureContainer(ServiceRegistry services)
        {
             ...
services.Scan(scan =>
             {
...