Dev Drive and Dotnet Tools

I recently tried out Dev Drive of Windows 11, where a ReFS partition can be created for your code and packages. It went smoothly and most of my projects were built successfully until it came to my Monogame project.

For your context, Monogame is a game engine written in .NET and allows you to write your game entirely in C#. It has a content pipeline to convert your audio and images assets to certain format, and the pipeline is written as local dotnet tools.

Turns out dotnet tools stop working after I moved Nuget package cache folder to the Dev Drive (with NUGET_PACKAGES environment variable). I tried to trigger the tool manually, but the error message is confusing an unhelpful:

I tried to check my Dev Drive and I can see dotnet-mgcb had been restored correctly. Looking a bit further, I realized that .NET is still trying to look for the tool in the old path in %userprofile%\.nuget (even after computer restart).

I might have guessed the issue by now: there must be a cache somewhere pointing to the old paths. Turned out local dotnet tools cache the package information (including the path) in %userprofile%\.dotnet\toolResolverCache.

The fix is obvious now:

  1. Empty %userprofile%\.dotnet\toolResolverCache
  2. Run dotnet tool restore again and double check toolResolverCache to ensure the files are recreated.

I think ideally, since dotnet tool restore can already get the package to the new cache folder in Dev Drive, it should also try to update this toolResolverCache folder automatically instead of requiring a manual wipe like this.

How to integrate Teamcity and GitLab CI

I note down the step I did to integrate TeamCity build server and GitLab CI pipeline. I am using TeamCity 2017.1.15 and GitLab 10.0.3.

What you will get with this integration:

  • Small green tick for each commit showing that a build has run successfully on the commit
  • Bigger tick for each merge request (MR) showing that a build has run successfully on the head of the merge request
  • Ability to enforce a successful build before any MR can be merged

How to set up the integration

Tldr, you need to go through 3 main steps:

  1. Enable TeamCity integration in your GitLab project settings
  2. Enable TeamCity build configuration to monitor and trigger build for all (CI) branches
  3. Enable “Commit status publisher” build feature

Read More

Kinect on Windows v2 keeps restarting

I have been playing with the Kinect for Windows v2 for a while, but I met a strange problem in the recent months: the Kinect kept restarting after 5 or 6 seconds. The RBG and depth channel looked fine in the Kinect Studio and Kinect Evolution, but the video stream kept running for 5-6 seconds then hung for 1-2 seconds (i.e. no new frame was received and the connection from the Kinect was actually lost). I have tried to reinstall the driver and SDK several times without much lucks. I though that it might be a problem with my Kinect, so I left it there until I can test with another Kinect.

Yesterday I tried to search for that problem on the Internet and found that several people also got the same issue. Someone on Microsoft’s forum suggested to disable Kinect audio and some other suggested to enable the audio device, so I decided to give it another try. It turned out that I have disabled Kinect Microphone Array. Re-enabling it fixed the strange problem.

It is a weird issue and does not seems to happen on older driver, and it is unfortunate that Kinect Studio could not give a better error message. I really hope that Microsoft would address that in a later version of driver and SDK, although I doubt that they will do that anytime soon.

Error! Can’t initialize plug-ins directory

I tried to install the new version of IntelliJ IDEA today and I got this strange problem.

Error! Can't initialize plug-ins directory. Please try again later!

Some searches on the Internet made me think that the problem was not from IDEA installer, but from Windows itself. I could later confirm that by fire up the installer of Format Factory and got the exact same error messages.

I took me an hour to try out different things until I got this forum thread: http://www.bleepingcomputer.com/forums/t/544157/error-cant-initialize-plug-ins-directory-please-try-again-later/.

Basically, the permission settings on the Temp folder of my user profile was messed up, and my account did not have any permission on that folder at that moment.
In short, the fixed is simply go to the Properties of that folder (you can type %temp% in Run to go to the folder directly), jump to Security tab, choose my user account, press Edit, and put a tick on Full control.
There were several error messages saying that I could not change the permission of some subfolder, but ignoring those folder does not causing me any problem till now.

I hope it help if you are having the same problem!

How to fix OneDrive crashes and manually reset its index

I am using OneDrive to store all my photos, documents, some portable software, PowerShell scripts, and many other things.

I was quite happy with it (especially the Smart File features where I can see and manage all my files on my small tablet) until I realized that my files were not synchronized any more. I then opened Task Manager trying to monitor the OneDrive Sync Engine (named SkyDrive.exe) and saw it kept crashing shortly after being launched.

Read More