Build/Test Issues

Razor page .Views.dll is not copied to integration test project

Started by tiesmaster on 2,145 views

Hi,

I've stumbled upon another problem with ASP.NET Core integration test. This time copying the Razor Page .Views.dll assembly is going wrong.

Context
In this case, I'm using Razor Pages, and testing them with the ASP.NET Core integration tests. I've reproduced the issue on this repo: https://github.com/tiesmaster/ReproduceNCrunchBug2. When I run this using other tooling, then the tests in UnitTest1 succeeds, however, when I run it from NCrunch it fails with a 404. This is caused because the assembly ReproduceNCrunchBug2.Views.dll is not copied to the integration test output path (as opposed to the main web dll).

I've played a bit with the settings, like enabling copy referenced assemblies to the workspace, as well as changed the instrumentation mode from default to optimized (default still goes to legacy, if I'm not mistaken; great post BTW!!!).

Steps to reproduce:
See the repo: https://github.com/tiesmaster/ReproduceNCrunchBug2

Expected result:
The test returns 200.

Actual result:
The Razor page for the index is not found, so the framework returns a 404.

Version Details:

  • NCrunch: 4.2.0.7
  • VS: 2019 16.4.3
  • .NET Core 3.1.1


Your help is greatly appreciated :)
Thanks for sharing this issue with the sample to reproduce it.

I can confirm that the problem is caused by NCrunch not copying the Views assembly between the workspaces. Doing this manually allows the tests to pass normally. The file isn't being copied by NCrunch as it's an unrecognised secondary output from the build system. We'll need to implement a targeted code change to handle it.

We'll let you know as soon as we have a fix available for this.
Thanks for your patience on this issue.

Would you mind trying the build below to see if it works for your actual solution? It passes the sample you posted.

NCrunch_Console_4.3.0.12.msi
NCrunch_Console_4.3.0.12.zip
NCrunch_GridNodeServer_4.3.0.12.msi
NCrunch_GridNodeServer_4.3.0.12.zip
NCrunch_LicenseServer_4.3.0.12.zip
NCrunch_VS2008_4.3.0.12.msi
NCrunch_VS2010_4.3.0.12.msi
NCrunch_VS2010_4.3.0.12.zip
NCrunch_VS2012_4.3.0.12.msi
NCrunch_VS2012_4.3.0.12.zip
NCrunch_VS2013_4.3.0.12.msi
NCrunch_VS2013_4.3.0.12.zip
NCrunch_VS2015_4.3.0.12.msi
NCrunch_VS2015_4.3.0.12.msi.7z
NCrunch_VS2015_4.3.0.12.zip
NCrunch_VS2017_4.3.0.12.msi
NCrunch_VS2017_4.3.0.12.msi.7z
NCrunch_VS2017_4.3.0.12.zip
NCrunch_VS2019_4.3.0.12.msi
NCrunch_VS2019_4.3.0.12.msi.7z
NCrunch_VS2019_4.3.0.12.zip
Awesome!! Totally fixes the problem. Very happy it's fixed this quickly! Thanks you

Post a reply

Log in to reply.