Skip to content

Why do we have to "Specify the Web SDK in the project file" when doing integration tests in ASP.NET Core? #49601

Answered by martincostello
edumserrano asked this question in Q&A
Discussion options

You must be logged in to vote

The reference means that some MSBuild targets will be pulled in that will copy files needed by things such as MVC and Razor Pages if you're doing UI tests (I think there's some other use cases too, but I forget what they are right now).

I would imagine that it was easier for the document to be written with "add this one line" rather than "add this one line if you do any of these X use cases".

If you remove it and your tests all still pass then I don't think there's any harm in you leaving it out, but for the sake of one line and potential future confusion it's probably best just to add it so things should "Just Work ™️" as your application and tests evolve over time.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Rick-Anderson
Comment options

You must be logged in to vote
1 reply
@martincostello
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
3 participants