Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 11 Beta Cannot start process because a file name has not been provided

This is what I'm getting when I build my Test project:

VS 11 Unit Testing Unexpected Error

With this I'm unable to run my tests since they're not being discovered by VS.

See the message "Unexpected error detected. Check the Tests Output Pane for details." at the window bottom. Now if you look at the Tests OUTPUT pane you'll have no clue about what's the problem. This is extremely helpful... :)

I know VS 11 is in beta but it used to work...

I've already restarted VS but it didn't work after that too.

Any ideas about what's going on? Would it be a bug somewhere?

Note: the only thing I can think is related with VS 2010 uninstall I did sometime ago. Maybe it uninstalled some necessary bits. Beats me...

EDIT 1
I just did a repair on VS 11 Beta Ultimate. It asked to reboot the computer once and I did. Then it continued the repair but kept working for more than 12 hours. I just killed the repair process.

In the meantime I uninstalled Visual Studio 11 Express for Web. I had this one side by side with VS 11 Beta Ultimate.

Crazily enough, it started working again after I did both things. So I don't know for sure what has solved the problem: the killed repair process or the uninstall of VS 11 Express for Web.

EDIT 2
For my disappointment now I see this is an intermittent thing. After restarting VS 11 Ultimate Beta the problem persists. :(

EDIT 3
I filled a Connect ticket at Microsoft but they closed it as not reproducible.

I made a 2nd try with VS 11 Ultimate Beta repair option and this time it finished as expected. To isolate the problem I created a brand new test project with a default UnitTest1.cs file within a new Solution and after building it I get the same error screen as shown above. So the repair option did not solve the problem. Looks like something is missing in my system.

This is the info from VS About window:

Microsoft Visual Studio 11
Version 11.0.50323.1 QRELB
Microsoft .NET Framework
Version 4.5.50131 QRELB

Installed Version: Ultimate

EDIT 4
I found a similar problem here but the solution given there doesn't apply in my case since I do not have the DLL described.

EDIT 5
With the help of Aseem Bansal's (a Microsoft employee) I finally got the logs and saw this exception:

W, 2124, 19, 2012/04/19, 11:51:32.644, 53768626724, devenv.exe, Exception occured while initialization System.InvalidOperationException: Cannot start process because a file name has not been provided.
   at System.Diagnostics.Process.Start()
   at Microsoft.VisualStudio.TestPlatform.Core.Utilities.CommonUtilities.LaunchProcess(String exeFileName, String commandLineArguments, String workingDirectory, IDictionary`2 environmentVariables)
   at Microsoft.VisualStudio.TestPlatform.Client.TestRunnerServiceClient.SetupProcess(Boolean forceX86Discoverer)
   at Microsoft.VisualStudio.TestPlatform.Client.TestRunnerServiceClient.Initialize_NoLock(Boolean forceX86Discoverer)
   at Microsoft.VisualStudio.TestPlatform.Client.TestRunnerServiceClient.EnsureInitialized(Boolean forceX86Discoverer)
   at Microsoft.VisualStudio.TestPlatform.Client.TestRunnerServiceClient.EnsureInitialized_NoError(Boolean forceDiscoveryInX86Mode)

EDIT 6
I tried executing the tests using the mstest.exe command-line tool (with and without the /noisolation option). The tests run as expected as can be seen here. So the problem is really something inside VS 11 Beta.

like image 745
Leniel Maccaferri Avatar asked Apr 15 '12 05:04

Leniel Maccaferri


1 Answers

Leniel,

Thanks for raising this issue.

As we discussed here, it indicates that shadow copy is causing the problem.

Please ensure that the Microsoft.VisualStudio.TestPlatform.Core.dll is loaded from its installation location %VSInstallDir%\Commmon7\IDE\CommonExtensions\Microsoft\TestWindow path and not from a temporary path like %appData%\assembly\dl3\ that you are observing right now. This should fix the problem for you.

Also I wanted to update you that in the latest code, we have improved our logic and with the improved logic, it would not matter from where the binary is getting loaded and it would just work for you.

Regards

Aseem Bansal

like image 59
Aseem Bansal Avatar answered Oct 30 '22 13:10

Aseem Bansal