Kevin Dente's Blog

The Blip in the Noise
Post-build events with VS.NET troubles

Hmm. It would seem that Visual Studio .NET 2003 doesn't like running post-build events for projects loaded from a UNC path. How terribly unfortunate. The error it gives is:

Performing Post-Build Event...
'\\unc\path\here'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
'PostBuildEvent.bat' is not recognized as an internal or external command,
operable program or batch file.

 

Published Friday, January 30, 2004 1:05 PM by kevindente

Comments

# re: Post-build events with VS.NET troubles@ Friday, January 30, 2004 4:41 PM

can you place the .bat file on a local folder, and have do whatever you need across the UNC's?

Derick Bailey

# re: Post-build events with VS.NET troubles@ Friday, January 30, 2004 5:45 PM

I don't think so. The IDE is calling a PostBuildEvent.bat file that it generates, and I don't see a way to control where that file gets created. The only option would be to put it in the Windows directory (where it defaults to) or build onto a local folder, neither of which is viable.

Kevin Dente

# re: Post-build events with VS.NET troubles@ Friday, January 30, 2004 6:44 PM

This problem apparently has a workaround and that is to map the UNC share to a drive and using that to load the project instead of UNC path.

Post build event will succeed in this case.

Thank you for reporting this issue, I am from C# IDE QA and I am happy to tell you that we are working to fix this in our future product release.

Thanks,
Suma[MS]

Suma

# re: Post-build events with VS.NET troubles@ Friday, January 30, 2004 7:47 PM

Suma,

Wow, customer service does house calls. :) Thanks, I also figured out that workaround. Glad to hear it'll be fixed in the future.

Kevin Dente

# re: Post-build events with VS.NET troubles@ Tuesday, July 20, 2004 8:21 PM

Microsoft have a knowledge base article about this issue: http://support.microsoft.com/default.aspx?scid=kb;EN-US;156276

You only need to add a registry key called DisableUNCCheck (DWORD) to HKCU\Software\Microsoft\Command Processor and set it to 1 hex.

Tried it, works great.

Geoff Bennett