简体   繁体   中英

Unit test exception in VS2015 Community

I created a new unit test project in VS 2015 Community, created a simple test method:

int a = 1;
int b = 2;

int c = a + b;

Then when I right click this test in the Test Explorer and select 'Debug Selected Test' I get the following exception:

System.IO.FileNotFoundException occurred Message: Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll Additional information: Não foi possível carregar arquivo ou assembly 'file:///C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO 14.0\\COMMON7\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\TESTWINDOW\\Extensions\\Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration.resources.dll' ou uma de suas dependências. O sistema não pode encontrar o arquivo especificado.

The dll file is there, but there's not .resources.dll file in that path.

Does anyone know why is it happening or how to solve it? I could just ignore, but the console is getting very messy with many of this exception being thrown.

I put the 3 code rows written in a test method in an empty project and it runs with Passed result and with no exception so the problem is not in code but in your Setup

If there is not that file in that path I think you already get the point :-)

I ran into the same problem after running my tests a few times. I even tried running empty test methods, but the exception kept getting thrown. Creating a new solution and adding the existing projects worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM