How to get Visual Studio to show hints and warning in a web-site?

别等时光非礼了梦想. 提交于 2019-12-24 04:37:06

问题


When you build a web-site in Visual Studio, it will not show you any Hints or Warning related to aspx markup files unless you have the file physically open in the editor.

For example, there is a Hint related to my Default.aspx file. But right now i only have the aspx.cs file visible:

If i build the solution (or Rebuild the solution, or Build the web-site, or re-build the web-site (whatever those different options mean)):

i get no hints or warnings about my web-site or solution:

------ Rebuild All started: Project: D:\...\WebSite\, Configuration: Debug Any CPU ------
Validating Web Site
Building directory '/WebSite/App_Code/'.
Building directory '/WebSite/Account/'.
Building directory '/WebSite/'.
Building directory '/WebSite/Scripts/'.

Validation Complete
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Nor do i get any hints or warnings about my web-site or solution:

But if i simply press F7 to make the markup file appear:

And build my solution (or rebuild my solution, or build my web-site, or rebuild my web-site (whatever those different options mean)), i get hints and warnings related to Default.aspx:

How do i make Visual Studio its job?

The only workaround i've been able to come up with is to open each file in the web-site, switch to the "designer" view, and then build the solution (or rebuild the solution, or build the web-site, or rebuild the web-site (whatever those different options mean)). When you have 60 or 70 pages, that gets quite tedious:

But at least i then get to see the hints and warnings in the web-site solution:

Is there a way to convince Visual Studio to build the entire solution? (Or rebuild the entire solution? Or build the entire web-site? Or rebuild the entire web-site? (Whatever those different options mean))

来源:https://stackoverflow.com/questions/25040574/how-to-get-visual-studio-to-show-hints-and-warning-in-a-web-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!