MattHoneycutt / SpecsFor

SpecsFor is a light-weight Behavior-Driven Development framework that focuses on ease of use for *developers* by minimizing testing friction.
http://specsfor.com
MIT License
196 stars 69 forks source link

MSBuild Error when trying to test? #58

Closed marius310 closed 9 years ago

marius310 commented 9 years ago

I have a standard n-tiered web application with several projects (core, application, webapi, EntityFramework and web). The SpecFor testing project has a dependency on the web project. When I try to run the tests, I get the following error. Any thoughts?

"C:...\xxxx.UnitSpecs.csproj" (default target) (1) -> (_CopyFilesMarkedCopyLocal target) -> C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3027: Could not copy "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". Exceeded retry count of 10. Failed. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3021: Unable to copy file "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". The process cannot access the file 'bin\Debug\xxxx.Web.dll' because it is being used by another process. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj]

MattHoneycutt commented 9 years ago

Are you using SpecsFor, or SpecsFor.Mvc (or both?)

It looks like something has a lock on the Web DLL, so it can't copy it over. I've had this happen before, and usually restarting Visual Studio and any orphaned IIS Express processes will resolve the issue. If that doesn't work, try using Process Explorer to see what has a lock on the DLL.

On Mon, Mar 2, 2015 at 1:20 PM marius310 notifications@github.com wrote:

I have a standard n-tiered web application with several projects (core, application, webapi, EntityFramework and web). The SpecFor testing project has a dependency on the web project. When I try to run the tests, I get the following error. Any thoughts?

"C:...\xxxx.UnitSpecs.csproj" (default target) (1) -> (_CopyFilesMarkedCopyLocal target) -> C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3027: Could not copy "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". Exceeded retry count of 10. Failed. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3021: Unable to copy file "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". The process cannot access the file 'bin\Debug\xxxx.Web.dll' because it is being used by another process. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj]

— Reply to this email directly or view it on GitHub https://github.com/MattHoneycutt/SpecsFor/issues/58.

marius310 commented 9 years ago

Using process explorer, nothing is locking this dll when Visual Studio is opened or when run all tests finishes. While the tests are running, vstest.executingengine.x86.exe has a lock on it. I'm not sure if this is normal, but the folders for each of my projects show up double in the process explorer with both entries being devenv.exe.

On Mon, Mar 2, 2015 at 3:29 PM, Matt Honeycutt notifications@github.com wrote:

Are you using SpecsFor, or SpecsFor.Mvc (or both?)

It looks like something has a lock on the Web DLL, so it can't copy it over. I've had this happen before, and usually restarting Visual Studio and any orphaned IIS Express processes will resolve the issue. If that doesn't work, try using Process Explorer to see what has a lock on the DLL.

On Mon, Mar 2, 2015 at 1:20 PM marius310 notifications@github.com wrote:

I have a standard n-tiered web application with several projects (core, application, webapi, EntityFramework and web). The SpecFor testing project has a dependency on the web project. When I try to run the tests, I get the following error. Any thoughts?

"C:...\xxxx.UnitSpecs.csproj" (default target) (1) -> (_CopyFilesMarkedCopyLocal target) -> C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3027: Could not copy "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". Exceeded retry count of 10. Failed. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3021: Unable to copy file "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". The process cannot access the file 'bin\Debug\xxxx.Web.dll' because it is being used by another process. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj]

— Reply to this email directly or view it on GitHub https://github.com/MattHoneycutt/SpecsFor/issues/58.

— Reply to this email directly or view it on GitHub https://github.com/MattHoneycutt/SpecsFor/issues/58#issuecomment-76810912 .

MattHoneycutt commented 9 years ago

Interesting, and is this with just SpecsFor? Is this output from SpecsFor.Mvc?

On Mon, Mar 2, 2015 at 6:01 PM marius310 notifications@github.com wrote:

Using process explorer, nothing is locking this dll when Visual Studio is opened or when run all tests finishes. While the tests are running, vstest.executingengine.x86.exe has a lock on it. I'm not sure if this is normal, but the folders for each of my projects show up double in the process explorer with both entries being devenv.exe.

On Mon, Mar 2, 2015 at 3:29 PM, Matt Honeycutt notifications@github.com wrote:

Are you using SpecsFor, or SpecsFor.Mvc (or both?)

It looks like something has a lock on the Web DLL, so it can't copy it over. I've had this happen before, and usually restarting Visual Studio and any orphaned IIS Express processes will resolve the issue. If that doesn't work, try using Process Explorer to see what has a lock on the DLL.

On Mon, Mar 2, 2015 at 1:20 PM marius310 notifications@github.com wrote:

I have a standard n-tiered web application with several projects (core, application, webapi, EntityFramework and web). The SpecFor testing project has a dependency on the web project. When I try to run the tests, I get the following error. Any thoughts?

"C:...\xxxx.UnitSpecs.csproj" (default target) (1) -> (_CopyFilesMarkedCopyLocal target) -> C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3027: Could not copy "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". Exceeded retry count of 10. Failed. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797,5): error MSB3021: Unable to copy file "C:...\xxxx.Web\bin\xxxx.Web.dll" to "bin\Debug\xxxx.Web.dll". The process cannot access the file 'bin\Debug\xxxx.Web.dll' because it is being used by another process. [C:...\xxxx.UnitSpecs\xxxx.UnitSpecs.csproj]

— Reply to this email directly or view it on GitHub https://github.com/MattHoneycutt/SpecsFor/issues/58.

— Reply to this email directly or view it on GitHub < https://github.com/MattHoneycutt/SpecsFor/issues/58#issuecomment-76810912> .

— Reply to this email directly or view it on GitHub https://github.com/MattHoneycutt/SpecsFor/issues/58#issuecomment-76857873 .

PanuO commented 9 years ago

I'm experiencing same problem. I'm trying to run SpecsFor.MVC tests with MSTest runner

MattHoneycutt commented 9 years ago

Can you share the code (or a slimmed down repro case) so that I can try it out? I'm afraid I can't reproduce the issue without more information.

marius310 commented 9 years ago

I am essentially using the AspBoilerplate infrastructure along with Module Zero. A sample project that is close to what I have can be found here: https://github.com/aspnetboilerplate/module-zero/tree/master/sample. I have SpecsFor and SpecsFor.MVC installed in my test project and am using MSTest runner.

After a recent update tot he AspBoilerplate project, the problem I described went away. I am currently working on correctly setting up the "Init" phase but I think I can figure that out now. I am doing this work as a side project and my apologies for taking so long to respond back. Thanks for you time.

MattHoneycutt commented 9 years ago

Awesome, that takes care of one person having this problem. PanuO, are you still experiencing this problem? If so, can you provide a repro case?

On Fri, Mar 27, 2015 at 10:07 AM marius310 notifications@github.com wrote:

I am essentially using the AspBoilerplate infrastructure along with Module Zero. A sample project that is close to what I have can be found here: https://github.com/aspnetboilerplate/module-zero/tree/master/sample. I have SpecsFor and SpecsFor.MVC installed in my test project and am using MSTest runner.

After a recent update tot he AspBoilerplate project, the problem I described went away. I am currently working on correctly setting up the "Init" phase but I think I can figure that out now. I am doing this work as a side project and my apologies for taking so long to respond back. Thanks for you time.

— Reply to this email directly or view it on GitHub https://github.com/MattHoneycutt/SpecsFor/issues/58#issuecomment-86966787 .

PanuO commented 9 years ago

Well I switched to NUnit because that seemed to work.

MattHoneycutt commented 9 years ago

I'm closing this out until I can get a repro case.