New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specs4Mvc fails during SetUp - 'build failed' #10

Closed
ctolkien opened this Issue Apr 2, 2013 · 44 comments

Comments

Projects
None yet
4 participants
@ctolkien

ctolkien commented Apr 2, 2013

I've followed the blog post verbatim, when I call: _host.Start();, it fails when a 'Build Failed' exception.

I can see the project has been built into the bin\debug\SpecsForMvc.TestSite and of course the project builds and runs fine on it's own. Any ideas?

@ghost ghost assigned MattHoneycutt Apr 3, 2013

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 3, 2013

Owner

Is there any additional information in the exception? It may contain additional clues in to why the build is failing.

Owner

MattHoneycutt commented Apr 3, 2013

Is there any additional information in the exception? It may contain additional clues in to why the build is failing.

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Apr 3, 2013

OK, I've pulled the source down and loaded it into my project.

IISTestRunnerAction.cs line 41 - success = project.Build();, this always returns false.

Checking the logs written to the temp directory:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5): error : Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Done building project "MyWebProject.Web.csproj" -- FAILED.

That's as far as I've been able to dig down the stack...

ctolkien commented Apr 3, 2013

OK, I've pulled the source down and loaded it into my project.

IISTestRunnerAction.cs line 41 - success = project.Build();, this always returns false.

Checking the logs written to the temp directory:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5): error : Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Done building project "MyWebProject.Web.csproj" -- FAILED.

That's as far as I've been able to dig down the stack...

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 3, 2013

Owner

Try running this command from either Powershell or cmd.exe:

msbuild "/p:DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=WebsiteTmp;AutoParameterizationWebConfigConnectionStrings=false;Platform=AnyCPU" /path/to/your/csproj.file

For example, here's the command I used to build and deploy the SpecsFor.Mvc.Demo project from Powershell:

msbuild "/p:DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=WebsiteTmp;AutoParameterizationWebConfigConnectionStrings=false;Platform=AnyCPU" .\SpecsFor.Mvc.Demo.csproj

That command-line is essentially the same thing SpecsFor.Mvc is doing when it deploys. Hopefully it will shed more light on the problem.

Owner

MattHoneycutt commented Apr 3, 2013

Try running this command from either Powershell or cmd.exe:

msbuild "/p:DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=WebsiteTmp;AutoParameterizationWebConfigConnectionStrings=false;Platform=AnyCPU" /path/to/your/csproj.file

For example, here's the command I used to build and deploy the SpecsFor.Mvc.Demo project from Powershell:

msbuild "/p:DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=WebsiteTmp;AutoParameterizationWebConfigConnectionStrings=false;Platform=AnyCPU" .\SpecsFor.Mvc.Demo.csproj

That command-line is essentially the same thing SpecsFor.Mvc is doing when it deploys. Hopefully it will shed more light on the problem.

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Apr 3, 2013

That command runs without error. "Build Succeeded, 0 warnings, 0 errors"

I've set the logging in IISTestRunnerAction.cs to 'Diagnostic':

Task "VSMSDeploy"
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load assembly Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load assembly Microsoft.Web.Delegation, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Starting Web deployment task from source: manifest(D:\Workspace\Project\obj\Debug\Package\Tab.Web.SourceManifest.xml) to Destination: package(D:\Workspace\Project\obj\Debug\Package\MyProject.Web.zip).
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5): error : Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Package failed.
Done executing task "VSMSDeploy" -- FAILED.
Done building target "PackageUsingManifest" in project "MyProject.Web.csproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "Package" in project "MyProject.Web.csproj" -- FAILED.

(Note I've changed the project names/paths to protect the innocent)

ctolkien commented Apr 3, 2013

That command runs without error. "Build Succeeded, 0 warnings, 0 errors"

I've set the logging in IISTestRunnerAction.cs to 'Diagnostic':

Task "VSMSDeploy"
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load assembly Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load assembly Microsoft.Web.Delegation, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Starting Web deployment task from source: manifest(D:\Workspace\Project\obj\Debug\Package\Tab.Web.SourceManifest.xml) to Destination: package(D:\Workspace\Project\obj\Debug\Package\MyProject.Web.zip).
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5): error : Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Package failed.
Done executing task "VSMSDeploy" -- FAILED.
Done building target "PackageUsingManifest" in project "MyProject.Web.csproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "Package" in project "MyProject.Web.csproj" -- FAILED.

(Note I've changed the project names/paths to protect the innocent)

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 3, 2013

Owner

Hmm, a quick Google seems to indicate that it might be a problem with
MSDeploy itself. Can you try reinstalling the latest version of MSDeploy?
http://www.iis.net/downloads/microsoft/web-deploy

On Tue, Apr 2, 2013 at 10:04 PM, Chad T notifications@github.com wrote:

That command runs without error. "Build Succeeded, 0 warnings, 0 errors"

I've set the logging in IISTestRunnerAction.cs to 'Diagnostic':

Task "VSMSDeploy"
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load
assembly Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load
assembly Microsoft.Web.Delegation, Version=7.1.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
Starting Web deployment task from source:
manifest(D:\Workspace\Project\obj\Debug\Package\Tab.Web.SourceManifest.xml)
to Destination:
package(D:\Workspace\Project\obj\Debug\Package\MyProject.Web.zip).
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5):
error : Web deployment task failed. (The type initializer for
'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Package failed.
Done executing task "VSMSDeploy" -- FAILED.
Done building target "PackageUsingManifest" in project
"MyProject.Web.csproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "Package" in project "MyProject.Web.csproj" -- FAILED.

(Note I've changed the project names/paths to protect the innocent)


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-15815243
.

Owner

MattHoneycutt commented Apr 3, 2013

Hmm, a quick Google seems to indicate that it might be a problem with
MSDeploy itself. Can you try reinstalling the latest version of MSDeploy?
http://www.iis.net/downloads/microsoft/web-deploy

On Tue, Apr 2, 2013 at 10:04 PM, Chad T notifications@github.com wrote:

That command runs without error. "Build Succeeded, 0 warnings, 0 errors"

I've set the logging in IISTestRunnerAction.cs to 'Diagnostic':

Task "VSMSDeploy"
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load
assembly Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
Package/Publish task Microsoft.Web.Publishing.Tasks.VSMSDeploy load
assembly Microsoft.Web.Delegation, Version=7.1.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
Starting Web deployment task from source:
manifest(D:\Workspace\Project\obj\Debug\Package\Tab.Web.SourceManifest.xml)
to Destination:
package(D:\Workspace\Project\obj\Debug\Package\MyProject.Web.zip).
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5):
error : Web deployment task failed. (The type initializer for
'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Package failed.
Done executing task "VSMSDeploy" -- FAILED.
Done building target "PackageUsingManifest" in project
"MyProject.Web.csproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "Package" in project "MyProject.Web.csproj" -- FAILED.

(Note I've changed the project names/paths to protect the innocent)


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-15815243
.

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Apr 3, 2013

Have uninstalled and re-installed MSDeploy, same outcome. Drawing a bit of a blank here as to what to try next?

ctolkien commented Apr 3, 2013

Have uninstalled and re-installed MSDeploy, same outcome. Drawing a bit of a blank here as to what to try next?

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 3, 2013

Owner

Hmm, since the command-line works fine, I might just ditch the API approach
for invoking MSBuild and just call the executable myself. Stand by, I'll
try to pull something together for that in the next day or two.

On Tue, Apr 2, 2013 at 10:22 PM, Chad T notifications@github.com wrote:

Have uninstalled and re-installed MSDeploy, same outcome. Drawing a bit of
a blank here as to what to try next?


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-15815659
.

Owner

MattHoneycutt commented Apr 3, 2013

Hmm, since the command-line works fine, I might just ditch the API approach
for invoking MSBuild and just call the executable myself. Stand by, I'll
try to pull something together for that in the next day or two.

On Tue, Apr 2, 2013 at 10:22 PM, Chad T notifications@github.com wrote:

Have uninstalled and re-installed MSDeploy, same outcome. Drawing a bit of
a blank here as to what to try next?


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-15815659
.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 4, 2013

Owner

Hi Chad, I just published a pre-release package of SpecsFor.Mvc 2.3 to NuGet. Can you pull that package and try again?

Owner

MattHoneycutt commented Apr 4, 2013

Hi Chad, I just published a pre-release package of SpecsFor.Mvc 2.3 to NuGet. Can you pull that package and try again?

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Apr 5, 2013

Hi Matt,

Still no luck I'm afraid - 'Build Failed':

Project "D:\Workspace\Project\MyProj.csproj" (Build target(s)):

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5): error : Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Done building project "MyProj.csproj" -- FAILED.

ctolkien commented Apr 5, 2013

Hi Matt,

Still no luck I'm afraid - 'Build Failed':

Project "D:\Workspace\Project\MyProj.csproj" (Build target(s)):

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5): error : Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Done building project "MyProj.csproj" -- FAILED.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 5, 2013

Owner

Hmm, I don't suppose you can strip it down to an example you could share
with me?

On Fri, Apr 5, 2013 at 1:09 AM, Chad T notifications@github.com wrote:

Hi Matt,

Still no luck I'm afraid - 'Build Failed':

Project "D:\Workspace\Project\MyProj.csproj" (Build target(s)):

C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5):
error : Web deployment task failed. (The type initializer for
'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Done building project "MyProj.csproj" -- FAILED.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-15940417
.

Owner

MattHoneycutt commented Apr 5, 2013

Hmm, I don't suppose you can strip it down to an example you could share
with me?

On Fri, Apr 5, 2013 at 1:09 AM, Chad T notifications@github.com wrote:

Hi Matt,

Still no luck I'm afraid - 'Build Failed':

Project "D:\Workspace\Project\MyProj.csproj" (Build target(s)):

C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3833,5):
error : Web deployment task failed. (The type initializer for
'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)
Done building project "MyProj.csproj" -- FAILED.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-15940417
.

@stephencoombs

This comment has been minimized.

Show comment
Hide comment
@stephencoombs

stephencoombs Apr 6, 2013

I had a problem with my solution where I started to get "build failed", it turned out to be that a newly added project did not have the same configuration that I was using on all other projects i.e. "Test" as it only had the default ones of debug and release. Just went into the configuration manager of the solution and ensured that they all had the same configurations

stephencoombs commented Apr 6, 2013

I had a problem with my solution where I started to get "build failed", it turned out to be that a newly added project did not have the same configuration that I was using on all other projects i.e. "Test" as it only had the default ones of debug and release. Just went into the configuration manager of the solution and ensured that they all had the same configurations

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Apr 25, 2013

Owner

Hi Chad, I wanted to follow back up and see if anything had changed on this issue. Any chance you could strip down the project so that you could share it with me?

Owner

MattHoneycutt commented Apr 25, 2013

Hi Chad, I wanted to follow back up and see if anything had changed on this issue. Any chance you could strip down the project so that you could share it with me?

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Apr 25, 2013

Hi Matt, appreciate the follow up. As soon as I get a chance I'll strip this down, give me a week or so.

Sent from my Windows Phone


From: Matt Honeycuttmailto:notifications@github.com
Sent: ‎26/‎04/‎2013 1:16 AM
To: MattHoneycutt/SpecsFormailto:SpecsFor@noreply.github.com
Cc: Chad Tmailto:chad@tolkien.id.au
Subject: Re: [SpecsFor] Specs4Mvc fails during SetUp - 'build failed' (#10)

Hi Chad, I wanted to follow back up and see if anything had changed on this issue. Any chance you could strip down the project so that you could share it with me?


Reply to this email directly or view it on GitHub:
#10 (comment)

ctolkien commented Apr 25, 2013

Hi Matt, appreciate the follow up. As soon as I get a chance I'll strip this down, give me a week or so.

Sent from my Windows Phone


From: Matt Honeycuttmailto:notifications@github.com
Sent: ‎26/‎04/‎2013 1:16 AM
To: MattHoneycutt/SpecsFormailto:SpecsFor@noreply.github.com
Cc: Chad Tmailto:chad@tolkien.id.au
Subject: Re: [SpecsFor] Specs4Mvc fails during SetUp - 'build failed' (#10)

Hi Chad, I wanted to follow back up and see if anything had changed on this issue. Any chance you could strip down the project so that you could share it with me?


Reply to this email directly or view it on GitHub:
#10 (comment)

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls May 27, 2013

I'm running into the same issue. I can run unit tests (using MSUnit) just fine by using a 3rd-party test runner (CodeRush) but if I try to use the test runner built into VS2012 I get a "Build failed" on _host.Start(). I ran the command line above (msbuild) and the build succeeded. If I get some time I'll try to reproduce in a sample as well.

nwoolls commented May 27, 2013

I'm running into the same issue. I can run unit tests (using MSUnit) just fine by using a 3rd-party test runner (CodeRush) but if I try to use the test runner built into VS2012 I get a "Build failed" on _host.Start(). I ran the command line above (msbuild) and the build succeeded. If I get some time I'll try to reproduce in a sample as well.

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien May 27, 2013

Hi @nwoolls I'm using a 3rd party test runner as well.. Sorry @MattHoneycutt I haven't had a chance to strip this down yet...

ctolkien commented May 27, 2013

Hi @nwoolls I'm using a 3rd party test runner as well.. Sorry @MattHoneycutt I haven't had a chance to strip this down yet...

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls May 28, 2013

Here is a simple project that reproduces this issue on my system. I have tried this without the 3rd-party test runner loaded and the issue persists, so I don't think it's a conflict there.

Project: https://www.dropbox.com/s/1uvxoyswadc35ww/SpecsForMvcDemo.7z
Video: http://screencast.com/t/GSJqmhbCKEk

nwoolls commented May 28, 2013

Here is a simple project that reproduces this issue on my system. I have tried this without the 3rd-party test runner loaded and the issue persists, so I don't think it's a conflict there.

Project: https://www.dropbox.com/s/1uvxoyswadc35ww/SpecsForMvcDemo.7z
Video: http://screencast.com/t/GSJqmhbCKEk

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt May 29, 2013

Owner

Thanks, Nate. I'll give this a shot and see what happens...

On Tue, May 28, 2013 at 10:44 AM, Nate Woolls notifications@github.comwrote:

Here is a simple project that reproduces this issue on my system. I have
tried this without the 3rd-party test runner loaded and the issue persists,
so I don't think it's a conflict there.

Project: https://www.dropbox.com/s/1uvxoyswadc35ww/SpecsForMvcDemo.7z
Video: http://screencast.com/t/GSJqmhbCKEk


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18559273
.

Owner

MattHoneycutt commented May 29, 2013

Thanks, Nate. I'll give this a shot and see what happens...

On Tue, May 28, 2013 at 10:44 AM, Nate Woolls notifications@github.comwrote:

Here is a simple project that reproduces this issue on my system. I have
tried this without the 3rd-party test runner loaded and the issue persists,
so I don't think it's a conflict there.

Project: https://www.dropbox.com/s/1uvxoyswadc35ww/SpecsForMvcDemo.7z
Video: http://screencast.com/t/GSJqmhbCKEk


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18559273
.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt May 30, 2013

Owner

I was able to reproduce the failure with your project, Nate. It works fine with TestDriven.NET, but fails with the VS test runner. I'm going to switch to invoking MSBuild.exe directly from SpecsFor.Mvc instead of using the API. It'll be a bit, but I'll try to have something knocked out by the weekend.

Owner

MattHoneycutt commented May 30, 2013

I was able to reproduce the failure with your project, Nate. It works fine with TestDriven.NET, but fails with the VS test runner. I'm going to switch to invoking MSBuild.exe directly from SpecsFor.Mvc instead of using the API. It'll be a bit, but I'll try to have something knocked out by the weekend.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls May 30, 2013

Awesome thanks so much Matt. I love the framework and it's working great, but I'd like the ability to get back the metrics and analysis that the VS test runner provides.

nwoolls commented May 30, 2013

Awesome thanks so much Matt. I love the framework and it's working great, but I'd like the ability to get back the metrics and analysis that the VS test runner provides.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 4, 2013

Owner

I just published a new preview NuGet package, 2.4.0-Test1. This version uses MSBuild.exe to do the deployment instead of the MSBuild API. Can you give this package a shot? I tested it with the sample solution you provided, Nathan, and it worked fine.

Owner

MattHoneycutt commented Jun 4, 2013

I just published a new preview NuGet package, 2.4.0-Test1. This version uses MSBuild.exe to do the deployment instead of the MSBuild API. Can you give this package a shot? I tested it with the sample solution you provided, Nathan, and it worked fine.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 4, 2013

I tried 2.4.0-Test1. Unfortunately, in both my real project and the test project I linked above I still get the same Build failed error when using the MSTest runner. In addition, I now get the same error when I use my 3rd-party test runner as well.

nwoolls commented Jun 4, 2013

I tried 2.4.0-Test1. Unfortunately, in both my real project and the test project I linked above I still get the same Build failed error when using the MSTest runner. In addition, I now get the same error when I use my 3rd-party test runner as well.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 4, 2013

Owner

Hmm, check the test output in MS Test. You should see the raw output from
MSBuild. Can you paste that here?

On Mon, Jun 3, 2013 at 11:12 PM, Nate Woolls notifications@github.comwrote:

I tried 2.4.0-Test1. Unfortunately, in both my real project and the test
project I linked above I still get the same Build failed error when using
the MSTest runner. In addition, I now get the same error when I use my
3rd-party test runner as well.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18888256
.

Owner

MattHoneycutt commented Jun 4, 2013

Hmm, check the test output in MS Test. You should see the raw output from
MSBuild. Can you paste that here?

On Mon, Jun 3, 2013 at 11:12 PM, Nate Woolls notifications@github.comwrote:

I tried 2.4.0-Test1. Unfortunately, in both my real project and the test
project I linked above I still get the same Build failed error when using
the MSTest runner. In addition, I now get the same error when I use my
3rd-party test runner as well.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18888256
.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 4, 2013

If I go to the Output window and select Show output from Tests, I see:

------ Run test started ------
========== Run test finished: 1 run (0:00:02.9123277) ==========

If I click the Output link for the failed test itself, this is what I see:

Test Name: Login_InvalidInput_TriggersValidation
Test Outcome: Failed
Result Message: Assembly Initialization method SpecsForMvcDemo.IntegrationTests.MvcAppConfig.MyAssemblyInitialize threw exception. System.ApplicationException: System.ApplicationException: Build failed.. Aborting test execution.
Result StandardOutput:
The publish failed.
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18046]
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Projects\Personal\1

For switch syntax, type "MSBuild /help"

nwoolls commented Jun 4, 2013

If I go to the Output window and select Show output from Tests, I see:

------ Run test started ------
========== Run test finished: 1 run (0:00:02.9123277) ==========

If I click the Output link for the failed test itself, this is what I see:

Test Name: Login_InvalidInput_TriggersValidation
Test Outcome: Failed
Result Message: Assembly Initialization method SpecsForMvcDemo.IntegrationTests.MvcAppConfig.MyAssemblyInitialize threw exception. System.ApplicationException: System.ApplicationException: Build failed.. Aborting test execution.
Result StandardOutput:
The publish failed.
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18046]
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Projects\Personal\1

For switch syntax, type "MSBuild /help"

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 4, 2013

Owner

Ah, is there a space in the path to your MVC project?

On Mon, Jun 3, 2013 at 11:49 PM, Nate Woolls notifications@github.comwrote:

If I go to the Output window and select Show output from Tests, I see:

------ Run test started ------
========== Run test finished: 1 run (0:00:02.9123277) ==========

If I click the Output link for the failed test itself, this is what I see:

Test Name: Login_InvalidInput_TriggersValidation
Test Outcome: Failed
Result Message: Assembly Initialization method
SpecsForMvcDemo.IntegrationTests.MvcAppConfig.MyAssemblyInitialize threw
exception. System.ApplicationException: System.ApplicationException: Build
failed.. Aborting test execution.
Result StandardOutput:

The publish failed.
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18046]
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Projects\Personal\1

For switch syntax, type "MSBuild /help"


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18889019
.

Owner

MattHoneycutt commented Jun 4, 2013

Ah, is there a space in the path to your MVC project?

On Mon, Jun 3, 2013 at 11:49 PM, Nate Woolls notifications@github.comwrote:

If I go to the Output window and select Show output from Tests, I see:

------ Run test started ------
========== Run test finished: 1 run (0:00:02.9123277) ==========

If I click the Output link for the failed test itself, this is what I see:

Test Name: Login_InvalidInput_TriggersValidation
Test Outcome: Failed
Result Message: Assembly Initialization method
SpecsForMvcDemo.IntegrationTests.MvcAppConfig.MyAssemblyInitialize threw
exception. System.ApplicationException: System.ApplicationException: Build
failed.. Aborting test execution.
Result StandardOutput:

The publish failed.
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18046]
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Projects\Personal\1

For switch syntax, type "MSBuild /help"


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18889019
.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 4, 2013

Several :)

nwoolls commented Jun 4, 2013

Several :)

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 4, 2013

Owner

Ok, that's probably it. I'll publish a new version tonight that handles
that, I completely forgot about it when I was rewriting the publish stuff.

On Tue, Jun 4, 2013 at 8:17 AM, Nate Woolls notifications@github.comwrote:

Several :)


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18908081
.

Owner

MattHoneycutt commented Jun 4, 2013

Ok, that's probably it. I'll publish a new version tonight that handles
that, I completely forgot about it when I was rewriting the publish stuff.

On Tue, Jun 4, 2013 at 8:17 AM, Nate Woolls notifications@github.comwrote:

Several :)


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18908081
.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 4, 2013

I can confirm that moving both projects to a path without spaces does seem to work with the test build in Nuget.

nwoolls commented Jun 4, 2013

I can confirm that moving both projects to a path without spaces does seem to work with the test build in Nuget.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 4, 2013

Owner

Great! I'll make a fix for the spacing issue tonight, then I'll push up
the final version of 2.4.

On Tue, Jun 4, 2013 at 10:09 AM, Nate Woolls notifications@github.comwrote:

I can confirm that moving both projects to a path without spaces does seem
to work with the test build in Nuget.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18915546
.

Owner

MattHoneycutt commented Jun 4, 2013

Great! I'll make a fix for the spacing issue tonight, then I'll push up
the final version of 2.4.

On Tue, Jun 4, 2013 at 10:09 AM, Nate Woolls notifications@github.comwrote:

I can confirm that moving both projects to a path without spaces does seem
to work with the test build in Nuget.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18915546
.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 5, 2013

Owner

I decided to publish another test just to be safe. Please pull down the latest pre-release NuGet package whenever you have, and let me know if it works for you. Thanks for your help in tracking down and troubleshooting this issue!

Owner

MattHoneycutt commented Jun 5, 2013

I decided to publish another test just to be safe. Please pull down the latest pre-release NuGet package whenever you have, and let me know if it works for you. Thanks for your help in tracking down and troubleshooting this issue!

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 5, 2013

Works fantastic! Both the VS built-in test runner and the 3rd-party runner I use are working well. Thanks for the prompt fixes and the great framework.

nwoolls commented Jun 5, 2013

Works fantastic! Both the VS built-in test runner and the 3rd-party runner I use are working well. Thanks for the prompt fixes and the great framework.

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Jun 5, 2013

Hrmm.. I'm not having the same amount of luck... Although I'm unsure if this is to do with something I'm doing wrong with the config.

Using the test runner built into VS - it seems to work (at least, I don't get an exception).

Using the Telerik 'Just Code' test runner as well as the test runner in NCrunch, it fails with a null reference exception when first setting up the config:

var config = new SpecsForMvcConfig();

            config.UseIISExpress()
                .With(Project.Named("Foo.Bar"))
                .ApplyWebConfigTransformForConfig("Debug");



Object reference not set to an instance of an object. at SpecsFor.Mvc.Project.Named(String projectName)

Aside, I'm not using NUnit (am using XUnit), but it doesn't look like it's even getting that far.

ctolkien commented Jun 5, 2013

Hrmm.. I'm not having the same amount of luck... Although I'm unsure if this is to do with something I'm doing wrong with the config.

Using the test runner built into VS - it seems to work (at least, I don't get an exception).

Using the Telerik 'Just Code' test runner as well as the test runner in NCrunch, it fails with a null reference exception when first setting up the config:

var config = new SpecsForMvcConfig();

            config.UseIISExpress()
                .With(Project.Named("Foo.Bar"))
                .ApplyWebConfigTransformForConfig("Debug");



Object reference not set to an instance of an object. at SpecsFor.Mvc.Project.Named(String projectName)

Aside, I'm not using NUnit (am using XUnit), but it doesn't look like it's even getting that far.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 5, 2013

Owner

Hi Chad, I have a theory about what's causing your issue. I just published
another test package. Can you pull that one and give it a shot? It will
still fail (I think), but it should write some useful debug info to the
stdout stream that your test runner should expose.

In any case, I don't think SpecsFor.Mvc will work very well with NCrunch's
default configuration. At a minimum, I'd recommend telling NCrunch not to
run the tests in parallel. You may also need to work around NCrunch's
shadow copy behavior as described here:
http://forum.ncrunch.net/yaf_postst271_Original-test-assembly-location-before-shadow-copy.aspx.
The 'Project.Named' helper only works if your tests are being executed
from the same directory hierarchy that contains your project and solution,
which isn't the case when using NCrunch. It could be that 'Just Code' is
doing something similar.

Please let me know what the test output contains, and I might be able to
come up with a better workaround, or at least a more helpful error message.

On Tue, Jun 4, 2013 at 10:55 PM, Chad T notifications@github.com wrote:

Hrmm.. I'm not having the same amount of luck... Although I'm unsure if
this is to do with something I'm doing wrong with the config.

Using the test runner built into VS - it seems to work (at least, I don't
get an exception).

Using the Telerik 'Just Code' test runner as well as the test runner in
NCrunch, it fails with a null reference exception when first setting up the
config:

var config = new SpecsForMvcConfig();

        config.UseIISExpress()
            .With(Project.Named("Foo.Bar"))
            .ApplyWebConfigTransformForConfig("Debug");

Object reference not set to an instance of an object. at SpecsFor.Mvc.Project.Named(String projectName)

Aside, I'm not using NUnit (am using XUnit), but it doesn't look like it's
even getting that far.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18954237
.

Owner

MattHoneycutt commented Jun 5, 2013

Hi Chad, I have a theory about what's causing your issue. I just published
another test package. Can you pull that one and give it a shot? It will
still fail (I think), but it should write some useful debug info to the
stdout stream that your test runner should expose.

In any case, I don't think SpecsFor.Mvc will work very well with NCrunch's
default configuration. At a minimum, I'd recommend telling NCrunch not to
run the tests in parallel. You may also need to work around NCrunch's
shadow copy behavior as described here:
http://forum.ncrunch.net/yaf_postst271_Original-test-assembly-location-before-shadow-copy.aspx.
The 'Project.Named' helper only works if your tests are being executed
from the same directory hierarchy that contains your project and solution,
which isn't the case when using NCrunch. It could be that 'Just Code' is
doing something similar.

Please let me know what the test output contains, and I might be able to
come up with a better workaround, or at least a more helpful error message.

On Tue, Jun 4, 2013 at 10:55 PM, Chad T notifications@github.com wrote:

Hrmm.. I'm not having the same amount of luck... Although I'm unsure if
this is to do with something I'm doing wrong with the config.

Using the test runner built into VS - it seems to work (at least, I don't
get an exception).

Using the Telerik 'Just Code' test runner as well as the test runner in
NCrunch, it fails with a null reference exception when first setting up the
config:

var config = new SpecsForMvcConfig();

        config.UseIISExpress()
            .With(Project.Named("Foo.Bar"))
            .ApplyWebConfigTransformForConfig("Debug");

Object reference not set to an instance of an object. at SpecsFor.Mvc.Project.Named(String projectName)

Aside, I'm not using NUnit (am using XUnit), but it doesn't look like it's
even getting that far.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18954237
.

@ctolkien

This comment has been minimized.

Show comment
Hide comment
@ctolkien

ctolkien Jun 5, 2013

Hi Matt, Cheers for chasing that up so quickly - your hunch is bang on:

*** ConsoleOutput ***

Beginning search for project 'Foo.Bar' in directory 'C:\Users\My Name\AppData\Local\NCrunch\28128\31\Foo.Bar.Tests\bin\Debug'...

*** Failures ***

Exception
System.InvalidOperationException: System.InvalidOperationException : Unable to find solution file, traversed up to 'C:'. Your test runner may be using shadow-copy to create a clone of your working directory. The Project.Named method does not currently support this behavior. You must manually specify the path to the project to be tested instead.


Pretty much the exact same response from the Just Code runner as well.

ctolkien commented Jun 5, 2013

Hi Matt, Cheers for chasing that up so quickly - your hunch is bang on:

*** ConsoleOutput ***

Beginning search for project 'Foo.Bar' in directory 'C:\Users\My Name\AppData\Local\NCrunch\28128\31\Foo.Bar.Tests\bin\Debug'...

*** Failures ***

Exception
System.InvalidOperationException: System.InvalidOperationException : Unable to find solution file, traversed up to 'C:'. Your test runner may be using shadow-copy to create a clone of your working directory. The Project.Named method does not currently support this behavior. You must manually specify the path to the project to be tested instead.


Pretty much the exact same response from the Just Code runner as well.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 5, 2013

Matt, with these latest changes the console windows no longer display when running using the VS test runner. I'm not sure if this is by-design or not. However, many times these consoles are left open by SpecsFor.Mvc (usually if there's some error) and I can close them myself. Now I'm noticing after quitting VS there's a bunch of "IIS Express Worker Process" processes running that I have to kill manually.

nwoolls commented Jun 5, 2013

Matt, with these latest changes the console windows no longer display when running using the VS test runner. I'm not sure if this is by-design or not. However, many times these consoles are left open by SpecsFor.Mvc (usually if there's some error) and I can close them myself. Now I'm noticing after quitting VS there's a bunch of "IIS Express Worker Process" processes running that I have to kill manually.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 5, 2013

Actually, in testing this further, it seems like SpecsFor.Mvc fires up a new copy of IIS Express Worker Process every time a test is run, whether it fails or not, and the process hangs around in memory until manually killed.

nwoolls commented Jun 5, 2013

Actually, in testing this further, it seems like SpecsFor.Mvc fires up a new copy of IIS Express Worker Process every time a test is run, whether it fails or not, and the process hangs around in memory until manually killed.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 6, 2013

Owner

I did hide the IIS Express window in the new version, but it should not be
spinning up a new copy of IIS Express every time. It should spin up a
single instance for the integration test host. Are you creating multiple
hosts during your tests? Typically you'll want to create the host once
during a setup fixture, then dispose of it at the end after all your tests
have completed.

On Wed, Jun 5, 2013 at 11:41 AM, Nate Woolls notifications@github.comwrote:

Actually, in testing this further, it seems like SpecsFor.Mvc fires up a
new copy of IIS Express Worker Process every time a test is run, whether it
fails or not, and the process hangs around in memory until manually killed.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18990586
.

Owner

MattHoneycutt commented Jun 6, 2013

I did hide the IIS Express window in the new version, but it should not be
spinning up a new copy of IIS Express every time. It should spin up a
single instance for the integration test host. Are you creating multiple
hosts during your tests? Typically you'll want to create the host once
during a setup fixture, then dispose of it at the end after all your tests
have completed.

On Wed, Jun 5, 2013 at 11:41 AM, Nate Woolls notifications@github.comwrote:

Actually, in testing this further, it seems like SpecsFor.Mvc fires up a
new copy of IIS Express Worker Process every time a test is run, whether it
fails or not, and the process hangs around in memory until manually killed.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-18990586
.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 6, 2013

Hi Matt - thanks for the response. Can you try the same sample I posted previously? I am calling Shutdown() on the host during AssemblyCleanup and I have verified that it is being called. However, if I keep running tests in that sample project I can see that a new copy of the IIS Express Worker is fired up each time.

nwoolls commented Jun 6, 2013

Hi Matt - thanks for the response. Can you try the same sample I posted previously? I am calling Shutdown() on the host during AssemblyCleanup and I have verified that it is being called. However, if I keep running tests in that sample project I can see that a new copy of the IIS Express Worker is fired up each time.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 7, 2013

Owner

Hi Chad, looks like both NCrunch and Just Code have an option that allows you to disable the shadow copy behavior. I don't see another good way around it from my end, but I'm open to suggestions.

Owner

MattHoneycutt commented Jun 7, 2013

Hi Chad, looks like both NCrunch and Just Code have an option that allows you to disable the shadow copy behavior. I don't see another good way around it from my end, but I'm open to suggestions.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 7, 2013

Owner

Hi Nate, the RC1 preview release is now on NuGet. It includes a fix for the ghost IIS Express processes. That's my fault, apparently trying to hide the window in the background requires that I use a different approach for terminating the process.

Owner

MattHoneycutt commented Jun 7, 2013

Hi Nate, the RC1 preview release is now on NuGet. It includes a fix for the ghost IIS Express processes. That's my fault, apparently trying to hide the window in the background requires that I use a different approach for terminating the process.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 7, 2013

I'm only seeing a Test3 version available: https://nuget.org/packages/SpecsFor.Mvc/2.3.0

nwoolls commented Jun 7, 2013

I'm only seeing a Test3 version available: https://nuget.org/packages/SpecsFor.Mvc/2.3.0

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 7, 2013

Owner

Sorry about that. I just pushed a 'Test4' package now. Please let me know
if you can't see that one.

On Fri, Jun 7, 2013 at 8:47 AM, Nate Woolls notifications@github.comwrote:

I'm only seeing a Test3 version available:
https://nuget.org/packages/SpecsFor.Mvc/2.3.0


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-19107715
.

Owner

MattHoneycutt commented Jun 7, 2013

Sorry about that. I just pushed a 'Test4' package now. Please let me know
if you can't see that one.

On Fri, Jun 7, 2013 at 8:47 AM, Nate Woolls notifications@github.comwrote:

I'm only seeing a Test3 version available:
https://nuget.org/packages/SpecsFor.Mvc/2.3.0


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-19107715
.

@nwoolls

This comment has been minimized.

Show comment
Hide comment
@nwoolls

nwoolls Jun 7, 2013

I can confirm that Test4 no longer leaves copies of IIS Express Worker, chromedriver.exe, and Chrome.exe running.

nwoolls commented Jun 7, 2013

I can confirm that Test4 no longer leaves copies of IIS Express Worker, chromedriver.exe, and Chrome.exe running.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 7, 2013

Owner

Good deal, thanks for all your help in tracking this down. I'll probably
ship the final version of 2.3 sometime this weekend.

On Fri, Jun 7, 2013 at 9:24 AM, Nate Woolls notifications@github.comwrote:

I can confirm that Test4 no longer leaves copies of IIS Express Worker,
chromedriver.exe, and Chrome.exe running.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-19109983
.

Owner

MattHoneycutt commented Jun 7, 2013

Good deal, thanks for all your help in tracking this down. I'll probably
ship the final version of 2.3 sometime this weekend.

On Fri, Jun 7, 2013 at 9:24 AM, Nate Woolls notifications@github.comwrote:

I can confirm that Test4 no longer leaves copies of IIS Express Worker,
chromedriver.exe, and Chrome.exe running.


Reply to this email directly or view it on GitHubhttps://github.com/MattHoneycutt/SpecsFor/issues/10#issuecomment-19109983
.

@MattHoneycutt

This comment has been minimized.

Show comment
Hide comment
@MattHoneycutt

MattHoneycutt Jun 10, 2013

Owner

I'm going to call this one closed for now with the 2.4.0 final release. SpecsFor.Mvc now works with many 3rd party runners as well as Visual Studio's test runner.

I'd love to do something more to help with NCrunch and other test runners that use shadow copy, but there doesn't seem to be any way to divine the true path to the web project under test without resorting to runner-specific code, and that's something I'd like to avoid.

Owner

MattHoneycutt commented Jun 10, 2013

I'm going to call this one closed for now with the 2.4.0 final release. SpecsFor.Mvc now works with many 3rd party runners as well as Visual Studio's test runner.

I'd love to do something more to help with NCrunch and other test runners that use shadow copy, but there doesn't seem to be any way to divine the true path to the web project under test without resorting to runner-specific code, and that's something I'd like to avoid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment