Search code examples
visual-studio-2010compact-framework

PlatformVerificationTask internal error: "The file exists"


Anyone have any insight as to what this error is, and how to fix/avoid it?

Warning 1   An internal error occurred in PlatformVerificationTask. System.IO.IOException: The file exists.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.__Error.WinIOError()
   at System.IO.Path.GetTempFileName()
   at Microsoft.CompactFramework.Build.DeviceTypeResolver.CreateDynamicAssembly(String fileName)
   at Microsoft.CompactFramework.Build.DeviceTypeResolver.LoadAssembly(String codebase, Boolean canlock)
   at Microsoft.CompactFramework.Build.DeviceTypeResolver..ctor(ICollection references)
   at Microsoft.CompactFramework.Build.AsmmetaContext..ctor(String ndpversion, String platformFamily, String platformID, ICollection references)
   at Microsoft.CompactFramework.Build.Tasks.PlatformVerificationTask.Execute() 

I have doctored up a project to run the compiler to build .NET CF dlls from within VS2010, according to this SO question ( Building Compact Framework applications with VS2010 (without VS2005) ) . The build was working but now it stopped with this odd error.


Solution

  • I figured it out. By... uh.... Reading the documentation.

    The doc page for System.IO.Path.GetTempPathName says

    The GetTempFileName method will raise an IOException if it is used to create more than 65535 files without deleting previous temporary files.

    The GetTempFileName method will raise an IOException if no unique temporary file name is available. To resolve this error, delete all unneeded temporary files.

    So... I deleted the tmp????.tmp files from C:\Users\USERNAME\AppData\Local\Temp, and everything worked again.