[VB] MSBuild fails after doing a /t:Clean, with an error about a second reference to mscorlib

When I create a default NetMF Windows application in VB, I can build and run it just fine through the VS2013 IDE and the emulator. I can “Clean” the solution and rebuild and run without any issues.

However, doing this outside the ide, in a command prompt it fails. Doing this for a default C# NetMF Window application works without any problems.

Try this:
[ul]Create a default VB NetMF window application. Ensure it can build and run in the emulator.
Now open a VS2013 developer command prompt and goto the directory of the solution file.
Run MSBuild (no extra arguments, it should pick up the sln file and build it). It should build just fine without any issues.
Now do a clean: MSBuild /t:Clean. This will not throw any errors.
Now run MSBuild again (not extra paramters). This build constantly fails, no matter how many times you do it.[/ul]

[quote]“C:\Users\XXX\Documents\Visual Studio 2013\Projects\MFWindowApplication1\MFWindowApplication1.sln” (default target) (1) ->
“C:\Users\XXX\Documents\Visual Studio 2013\Projects\MFWindowApplication1\MFWindowApplication1\MFWindowApplication1.vbproj” (default target) (2) ->
(CoreCompile target) ->
vbc : Fatal error BC2000: compiler initialization failed unexpectedly: Project already has a reference to assembly mscorlib. A second reference to ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\mscorlib.dll’ cannot be added. [C:\Users\XXX\Documents\Visual Studio 2013\Projects\MFWindowApplication1\MFWindowApplication1\MFWindowApplication1.vbproj][/quote]

Now go back into the ide and try and rebuild and run. The first run (normally) fails. From the second one it normally starts running. I say normally because this is not consistent (and it is very worrying).

Microsoft ® Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
NetMF version 4.3

Can anyone else verify this, please?