views:

89

answers:

2

Is there a way to check for errors in unopened *.ASPX pages. For example, if you change the name of a function Visual Studio will catch the error on the page and list it in the "Error List" only if the page is opened and being validated?

I guess the question could be is there a validation option opposed to the compile option to check for errors?

(Yes, i know code should go into the pre-compiled code-behind pages.)

How do i find out about the following without running the page through the webserver or opening the page to be validated in VS?

<script runat="server">
     Public Sub MyFunciton() 
         Undefined_FUNCTION()
     End Sub
 </script>
+3  A: 

If you include a web deployment project in your solution and set it up to pre-compile your site, it will pick up these types of errors as it will compile the markup pages along with the code behind, whereas at the moment, you are only compiling your code behind and designer files

Daniel Dyson
+1  A: 

David Ebbo pointed me to this:

From a VS console window, go to the root of your site and run: aspnet_compiler -v foo -p . That should show you more errors than the Visual Studio compiler output.

Greg
Is there a way to get this into your compile or build options?
Glennular
Sorry, I'm not sure. I just do it on demand if I'm running into a sticky problem. Daniel's answer is probably the better answer.
Greg