How to fix lag with Bluetooth Logitech MX Master 3 and DELL XPS 9710

 

When I did not use the MX Master 3 for a minute, the mouse would lag, when starting the mouse again on a DELL XPS 9710.

Fixed this by changing the following registry keys:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_8087&PID_0026\5&2816b067&0&10\Device Parameters]

“DeviceSelectiveSuspended”=dword:00000000

“SelectiveSuspendEnabled”=dword:00000000

<

p style=”margin-left: 54pt”>”SelectiveSuspendSupported”=dword:00000000

 

and then rebooting Windows 10.

Using ‘winston-daily-rotate-file in TypeScript

 

In TypeScript you need to import the library ‘winston-daily-rotate-file’ like, so:

 

import ‘winston-daily-rotate-file’

 

import { createLoggerformatLoggertransports } from ‘winston’;

import ‘winston-daily-rotate-file’;

 

let _winstonLoggerLogger;

 

function initialise() {

  _winstonLogger = createLogger({

    format: format.json(),

    transports: [

      new transports.Console({

        format: format.combine(format.colorize(), format.simple()),

      }),

    ],

  });

}

 

function addRotatingFileSystemLogging() {

  const options = {

    filename: ‘application-%DATE%.log’,

    datePattern: ‘YYYY-MM-DD’// Rotate every day

    zippedArchive: true,

    maxSize: ’20m’,

    maxFiles: ’31d’

  };

 

  const transport = new transports.DailyRotateFile(options);

  _winstonLogger.add(transport);

}

 

<

p style=”background: #1e1e1e”>
 

 

 

Fixing Microsoft store error 0x80d02017

After running Windows update and rebooting, the Windows “Mail and calendar” app disappeared.

So, I went to the Microsoft Store app to install the Windows “Mail and calendar” app, but after clicking on “Install” I got the error message “0x80d02017”.

To fix the error I had to disable IPV6 on my network connection as described here: https://www.winhelponline.com/blog/microsoft-store-error-0x80d02017-windows-10/

 

 

How to call an async service function from an ASP .NET razor *.cshtml master page in Full .NET Framework 4.7.2

 

If you need to call an async C# service method from an ASP .NET razor page, you can use the System.Threading.Tasks.Task.Run method.

Assuming we have a C# service class “MyService.cs” and this service contains an async method called “GetMyData”, then you can call it in a razor page like so:

 

@{

    var myService = new MyService();

var myData = System.Threading.Tasks.Task.Run(() => myService.GetMyData()).GetAwaiter().GetResult();

}

 

 

How to quickly debug an ASP .NET Core MVC Api Controller by using an Unit Test project

 

When you have an ASP .NET Core MVC api controller and you want to quickly debug the controller endpoint, you can use the code below.

Just make sure, you set the “Copy to Output Directory” to “Copy always” or “Copy if newer” on the appsettings.json file, inside the unit test project.

 

Code

 

using System;

using System.Net.Http;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Hosting;

using Microsoft.AspNetCore.TestHost;

using Microsoft.Extensions.Configuration;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using XmlInterface.WebApi;

 

namespace UnitTest

{

    [TestClass]

    public class SpikeUnitTest

    {

        /// <summary>

        /// https://geeklearning.io/a-different-approach-to-test-your-asp-net-core-application/

        /// </summary>

        [TestMethod]

        public async Task Run()

        {

            IConfigurationRoot configuration = new ConfigurationBuilder()

            .SetBasePath(AppContext.BaseDirectory)

            .AddJsonFile(“appsettings.json”)

            .Build();

 

            // UseConfiguration

            var webHostBuilder = new WebHostBuilder();

            webHostBuilder

                .UseConfiguration(configuration)

                .UseStartup<Startup>();

 

            var testServer = new TestServer(webHostBuilder);

            HttpClient httpClient = testServer.CreateClient();

            var response = await httpClient.GetAsync(“/api/Test”);

 

            Assert.IsTrue(true);

        }

    }

}

<

p style=”background: #1e1e1e”>
 

 

 

 

 

How to fix: Can’t bind to ‘data’ since it isn’t a known property of ‘markdown’

After an Angular 11 update, the code:

<markdown
[data]=“model.someText”></markdown>

 

would throw an exception “Can’t bind to ‘data’ since it isn’t a known property of ‘markdown'” only in production builds.

Fixed this by adding

@NgModule({
  ...
  imports: [
    ...
    ...

                MarkdownModule.forRoot(),
  ],
  ...
})
export class AppModule {}

 

 

In the AppModule en in de Module containing the component with the template using the “markdown” tag, added:

 

@NgModule({
  ...
  imports: [
    ...

                , MarkdownModule.forChild()
                
  ],
  ...
})
export class CoreModule { }

Custom IHttpHandler 404 not found in .NET Framework 4.7.2

 

When you add a custom IHttpHandler to your ASP .NET Framework 4.7.2 project in a root folder like /Handlers/MyHandler.ashx and you access the url /Handlers/MyHandler.ashx, this handler will be executed,

But if you want this handler to be executed on another path, you will have to register the custom IHttpHandler.

 

In my case on IIS 10 with application pool in integrated mode (Managed Pipeline Mode = Integrated):

<system.webServer>
  ...
  <handlers>
    ...
    <add name="DownloadFile" verb="*" path="Helpers/DownloadFile.ashx" type="My.Custom.NameSpace.MyHandler, My.Assembly " resourceType="Unspecified" />
  </handlers>
</system.webServer>

 

But if you are also using MVC routing, you will have to ignore this route in the MVC routing:

 

public static void RegisterRoutes(RouteCollection routes)
{
            routes.IgnoreRoute("Handlers/MyHandler.ashx");

 

 

 

Solution

https://stackoverflow.com/questions/2858738/problem-mapping-httphandler-http-error-404-not-found/5247330

 

Fix .NET 4.7.3 MVC PowerShell msbuild csproj – ASPNETCOMPILER : error ASPRUNTIME: ‘/temp’ is not a valid IIS application.

 

 

On a specific system, when using msbuild in the folder: “C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin”, I was getting the error:

….csproj” (Build target) (1) ->

   (MvcBuildViews target) -&gt;


     ASPNETCOMPILER : error ASPRUNTIME: '/temp' is not a valid IIS application. [C:\Dev\pri\ZvdZOnline\Source\ZvdZOnline\Zv 


   dZOnline.Web\ZvdZOnline.Web.csproj]

 

But when I build the project by using msbuild found in “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin” the error was resolved.

 

To resolve the error with the msbuild found in “C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin”, I replaced the folder by one found on an other system, that did not have the error.

.NET 4.7.3 How to fix: The CodeDom provider type “Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” could not be located.

 

Solution

  • Close Visual Studio 2019
  • Remove package.lock.json
  • Execute: npm i
  • Open Visual Studio 2019
  • Rebuild project

 

 

 

Error

The CodeDom provider type “Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” could not be located.

File: …\ASPNETCOMPILER