-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Using TestServer to test MVC Views Fails with missing assembly refs #5826
Comments
@ardalis have you made progress here? If not, have a look at the workarounds Mvc uses for its own functional tests i.e. see https://github.com/aspnet/Mvc/blob/dev/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj |
I think this is a dup of #3410. |
@dougbu No this still is failing. In the test the response for any MVC View result throws all kinds of namespace not found errors from Razor, for example: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. I tried adding workarounds from the .csproj file you reference but so far no luck (and I'm not sure which ones were supposed to help). Do you have a minute to look at this project on my branch and see if you can help? |
@ardalis I'm wrapping up for the day soon. But, I suspect you've grabbed 1.2.0 workarounds and tried to use them in a 1.0.x world. Have a look at https://github.com/aspnet/Mvc/tree/rel/1.0.3/test/Microsoft.AspNetCore.Mvc.FunctionalTests instead. |
@dougbu No worries. Perhaps tomorrow. That branch is pre-CSPROJ/VS2017, which is what I'm on. |
Repro Steps:
https://github.com/aspnet/Docs/tree/master/aspnetcore/mvc/controllers/testing/sample/TestingControllersSample
You will get two failing tests for integration tests hitting MVC Views that worked previously. Examining the response returned shows it's a Razor Compilation issue.
I haven't found a workaround that will get these views to build properly from a separate integration test project (as they used to do in 1.0).
This may be related: https://developercommunity.visualstudio.com/content/problem/17274/razor.html @NTaylorMullen
Or this: #4818 (comment)
@pranavkm
I'd like to update this doc sample for VS2017 but am currently blocked until I can figure this out.
The text was updated successfully, but these errors were encountered: