File Path Size Does Matter

File Path Size Does Matter


Whilst building one of my side projects, I came across a problem in Visual Studio when it builds. The problem was ‘GenerateStaticWebAsssetsPropsFile task failed unexpectedly’. I spent a long time trying to fix the problem as, naturally, I thought I had done something wrong.

However, that wasn’t the case.

The Real Cause

The problem turned out to be that the path was too long. I had created folders on my desktop to house the code – I was only experimenting at the time – and the code was down another couple of folder levels. So the paths for the files were reasonably long but not too long. VS seemed quite happy.

However, the GenerateStaticWebAssetsPropsFile tasks has an internal limit on the file length.

What it should have done was report some sort of ‘path is too long’ error message but that was nowhere to be seen.

The Fix

The very simple fix was to move the folder containing the code into a path that wasn’t as long. Easy when you know how.

Other information

Ironically, there is a Microsoft forum post here that shows that even the Microsoft Engineering Support team don’t know about it: –


Hi, my name is Stephen Finchett. I have been a software engineer for over 30 years and worked on complex, business critical, multi-user systems for all of my career. For the last 15 years, I have been concentrating on web based solutions using the Microsoft Stack including ASP.Net, C#, TypeScript, SQL Server and running everything at scale within Kubernetes.