Compiler - Automating Finding Compile Errors In Pages?

Jan 20, 2011

I have an ASP.NET website where the pages call a few components in DLLs. I need to change the signature of a method in the component, and short of doing a text search, don't know if this will break any pages or not. IMO, this is the weakness of web programming -- you don't get the benefit of a compiler telling you about syntax errors.

But it doesn't need to be so. Does anyone know if there is a way to run a spider over a website watching for compile errors, or perhaps some tool that would compile all the .aspx files in a folder structure looking for compile errors?

This is merely for syntax checking -- not to actually pre-compile the website.

EDIT It looks like aspnet_compiler is being recommended. I don't use Visual Studio projects for the website -- it's grown over time with my own templating system (back before Master Pages were available). So something that would run aspnet_compiler over all the files in a folder might work...

View 3 Replies


Similar Messages:

Configuration :: Compiler Not Catching Compile Error?

Mar 10, 2010

Using VS2008 SP1, .NET 3.5 SP1, C# Web Application Project

As we know, Web Application Projects (unlike Web Site Projects) compile the entire site for deployment. We have discovered a situation where the visual studio compiler doesnt catch and error. Then when we deploy the dll to the website (or even just run it in the built in web server) it catches the error and displays it as a "compilation" error during runtime. This is obviously disturbing. Let me explain the error:

Take a single web page in a new C# web app project, such as the default.aspx. Add a checkbox. Create an event handler for the checked changed event. Note that it modifies the .aspx file to add oncheckedchanged="yourmethodhere" in the checkbox item. Compile and everything is fine.

Now change the name of the method in the .aspx file, say for yourmethodhere to yourmethodhere_1 and compile again. Note you havent change the code behind, so you SHOULD get a compile error. But you dont. Now if you deploy or debug it, you will get a compilation error during runtime.

Note: If you do exactly the same thing in a web SITE project, the validation compile that it does when you choose to "build" the project DOES catch this error. In other words, only c# web APPLICATION projects have this problem.

View 3 Replies

C# - Compile Errors On Deployed Web Application, But Not In The IDE?

Dec 30, 2010

In my deployed web application I am getting the following error:

CS0103: The name 'releaseLionButton_Click' does
not exist in the current context

It identifies this as the offending line:

<asp:Button ID="releaseLionButton" runat="server"
Text="Release the Lion!"
OnClick="releaseLionButton_Click"></asp:Button>

[code]...

View 2 Replies

Causes Transient Aspx First Line Compile Errors?

Feb 8, 2010

Every once in a while, when I'm editing an aspx or ascx page, Visual Studio will start telling me there is an error on the first line of my file. For instance, right now, it is saying Argument missing on line 1. That line is just your typical header, with no apparent problems (to my eyes), and I hadn't even changed that one when the error started appearing.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyControl.ascx.cs"
Inherits="MyNamespace.MyControl" Debug="true" %>

Unlike most compile errors, the build still succeeds. (At least this time it did.)

It's worth noting that no other errors or warnings are thrown by this file or its as[p|c]x.cs

Sometimes, to get out of it, I am forced to undo my changes until it disappears and carefully redo what I wanted. This time, grasping at straws, I cleaned and rebuilt the solution. While I was typing this, the error disappeared, sometime after the rebuild finished.

I have a suspicion that it often happens when I tinker with the databinding in my markup. Sometimes it seems to appear if I'm missing a space inside a tag before its closing slash, like so:

[...] Text='<%# Eval("Field") %>'/>

versus:

[...] Text='<%# Eval("Field") %>' />

...But that doesn't seem to have been the problem in this case.

When coding PHP and Perl, sometimes the interpreter would throw an error referencing the very last line of the file. Over time, I learned to look for imbalanced brackets and other delimiters somewhere up above. This problem in ASP.NET feels similar, but stranger, since it's the first line, and not just something amiss above, cascading down to the bottom. Or is it just Visual Studio getting temporarily confused? Can any pros shed some light on this problem, with reasons why it happens? I'd like to have some logic (as opposed to my own built up superstition) to throw at this the next time it rears its ugly head.

View 1 Replies

Configuration :: First Time Deploying A .Net Application, Get Compile Errors?

Mar 11, 2011

I am using TFS to build my MVC app. I cannot do it because I get lots of compile errors. I am using version 4 of .Net and MVC 2. On the build server I have the .Net framework 4.0 installed. It has been suggested that I should also download the MVC framework as well, but when I look on the net all I can find is this MVC framework; http://mvcframework.codeplex.com/ which does not seem to be relevant and does not work anyway.

One of the assemblies I am missing on the build server is System.Web.Mvc dll.Typical error messages include; "The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)"What do I need to do to fix this?

View 2 Replies

DataSource Controls :: Connection Strings Errors On Compile

Jun 8, 2010

I have a drop down with different domains(domain_id column) and a textbox (TextBoxComment) for comments. What I am trying to do is select the area, input a comment, click the button and have it save to the db. My connection string errors on compile.

[Code]....

View 8 Replies

MVC :: Referencing TempData On Master Page Causing Compile Errors?

Jan 29, 2010

Working through Steven Sanderson's excellent Pro ASP.Net MVC Framework book.I am trying to reference the TempData collection to display a message after an item has been successfully updated and so have placed a reference to this on my Master Page.[Code]....


This is giving me the following compile time errors:

Error 1 The name 'TempData' does not exist in the current context <programme location>

Error 2 The name 'TempData' does not exist in the current context <programme location>

If I reference TempData on a content page it compiles (and works) fine.

View 3 Replies

VS 2008 - How To Copy ASPX Page In A Solution And Not Compile Errors

Oct 31, 2011

I have a VS 2008 solution. I need to copy an existing .aspx page and re-name it to something else (need to make modifications to that newly copied page). But I keep getting compilation errors saying that duplicate text boxes exist. Can't I have control on different .aspx pages with the same name? How can I do this elegantly?

View 4 Replies

Visual Studio 2005 - Web Site Project - Errors Not Caught At Compile Time?

May 7, 2010

For the first time in my career, I'm working on an ASP.Net (v3.5) project that has been set up as a Visual Studio 2008/10 Web Site Project.

I'm not keen on this way of working this way for various reasons but for the moment and until such time as the company sees the virtue in working in an environment with namespaces, designer and project files etc., I have to continue with the existing codebase.

I've run into some odd issues since I began this but perhaps the oddest one of all is that althought VS lets me build the code, it doesn't reliably pick up compilation errors so these are not noticed until runtime.

I know the website model allows dynamic/hot compilation when a request is made for a specific but I can't see why it wouldn't do this when I manually (F5) build/rebuild the project. Its immensely annoying as you can imagine and I can't find a workaround.

View 3 Replies

1.1 - Use The Command Line Compiler Behind Pages Into The DLL

Sep 12, 2010

I need to use Notepad to make changes to an old .Net 1.1 app. I then would like to use the command line compiler. the syntax (and where I need to navigate to in my cmd) to compile the changes I make in the code behind pages into the DLL?

View 3 Replies

Configuration :: Finding Best Practice For Making Sure That Slow Pages Don't Affect Other Pages?

Aug 31, 2010

Page B - loads slowly and needs to do some CPU-intensive operations on the web server.

I noticed that when someone is loading Page B, then Page A also loads slowly. This is even worse if multiple users are loading Page B at the same time. Page A won't finish loading until Page B is done.

Is there a best practice for making sure that Page A can still load quickly? Maybe a config setting or IIS setting that I need to change from its default? With 2 users loading Page B at the same time, the web server CPU usage only gets to 30% so I suspect it might be something I can tweak with the settings.

View 1 Replies

Visual Studio - Finding Ways To Make Build Faster / Trying To Improve Edit-Compile-Test Loop

Mar 17, 2011

When I'm building my web project it takes about 20 seconds to compile. Then when I try to browse to a web page in project, asp.net does its runtime compilation(another 20 seconds). I know I can't escape these steps because thats how asp.net works, just want to see if anyone has some kind of optimization to make these builds faster.

Trying to improve Edit-Compile-Test loop

My machine details:

-Intel Core i7 processor @2.80GHz
-8GB of RAM
-HD @ 7200 RPM

View 4 Replies

Visual Studio 2010 - Site Upgraded VS08 - VS10, And Now Compile-time Errors Do Not Show Until I Request The Page At Run-time?

Mar 11, 2011

I have an ASP.NET website that worked fine using and debugging in VS2008. I went through the upgrade process opening the solution in VS2010. I can run the site, but as I make changes in the app_code folder classes, they don't seem to commpile and warn me of compile-time errors. As soon as I get to a point that calls the class, the errors show up. Sounds JIT I guess, but this isn't how it was working in 08. Is there an option that was changed in the upgrade process? This is a large project, I really don't want to break something and not find out until some obscure page is opened.

View 1 Replies

V4.0 IIS 7.0 Integrated Slow / Certain Pages And It Seems To Compile Again Next Time Go That Page Its Very Fast?

Feb 24, 2011

We recently migrated to v4 of .net. We are running iis 7 in integrated mode. When the site first starts its slow. I get that - it compiles for the first time. The odd thing is then we will go to certain pages and it seems to compile again. The next time i go that page its very fast. Nothing exceptional with the second page - but once that is hit the rest of the site is fast.

View 1 Replies

C# - Handle Errors On Certain Pages Differently?

Mar 28, 2011

I have an Application_Error handler in my Global.asax file. However, I load many pages using an XHR request and would rather these "sub pages" return javascript or a real 500 code for my main app to process, rather than an error page.

Is it possible to handle errors on certain pages in a different way? Can a master page handle its own errors in a page extending it without bubbling it up to Global.asax?

View 4 Replies

Getting The Errors For Code In Unopened .aspx Pages?

May 12, 2010

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?

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>

View 2 Replies

C# - Errors In Razor Pages Cause Server To Hang?

Feb 8, 2011

I've been writing an app using the awesome new Razor view engine and for the most part, things have been great.

One issue I keep running into, however, is that if I should happen to write invalid code, such as referencing a null property or even a non existent property, rather than throwing an error, something happens in the background that causes the browser to wait and wait and wait and if I do not cancel the browser's request quick enough, IIS will simply hang.

It seems as if it enters some sort of loop. CPU usage goes up (though not terribly high) and restarting IIS via either GUI or iisreset command seems to take abnormally long (presumably while it waits for the process to safely shutdown).

This also happens for other invalid code scenarios such as failing to close a code block with a closing brace.

View 1 Replies

Configuration :: Custom Errors For 404 Pages Not Working In Web.config?

Feb 2, 2010

For some reason the Custom Errors for 404 pages are not working on my production server, but they work fine on development. Instead of going to the custom 404.aspx page, it goes to the ugly IIS 404 page.

Here is my Custom Errors protion of my web.config:

[Code]....

I changed the defaultRedirect to also go to my 404.aspx page just to make sure I was catching everything, but still it does't work. I know I could change the IIS 404 error to also point to my 404.aspx page, but that will not work for me because I need to capture the "aspxerrorpath" in the querystring for .net 404 errors. The IIS method will not give me that.

I am just hoping it is a server configuration I missed somewhere, but everything on production looks the same as on development.

View 9 Replies

Configuration :: Regarding Error - Compiler Error Message: BC2000: Compiler Initialization Failed Unexpectedly

Mar 1, 2011

I am using windows 7, my application is working fine in visual studio but when i host it and browse it through my browser getting the following error. Sometime back it worked fine but recently it started giving this error. Server Error in '/InfraICHR' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC2000: compiler initialization

[Code]...

View 1 Replies

Web Forms :: Finding The Controls In Content Pages?

Feb 21, 2011

i have page which is derived from nested master page. Below is the hierarchy

Master.Master
Master2Column.master
Bronze.aspx

The aspx page is derived from master2column and which in turn is derived from master.master.

Now i need to find a control in bronze.aspx page from master.master.cs page. This is where i am getting lost.

My master.master has the contentplaceholder1. Below is my master2column

[Code]....

And the maincontent is in bronze.aspx page. Now i need to find a label called lblTo.

I tried this one

[Code]....

and few other options too. But still i am getting "Object reference not set to an instance of an object".

View 2 Replies

C# - Automating Storing App Settings In Web.config (Refactoring)?

Jul 21, 2010

There are a bunch of hardcoded strings in a ASP.NET application.

eg. string constSetting = "XYZ";

There are a LOT of them. Is there a tool/plugin for Visual Studio 2008 to refactor it in such a way that the constant string goes into web.config and the above line gets replaced by the retrieved string from web.config app settings?

View 2 Replies

Error Automating Word On Test Server?

Sep 20, 2010

I am trying to open a Word document from a .Net web application. The code (in brief) contains ...

using Word = Microsoft.Office.Interop.Word;
using System.Reflection;and, the code that actually creates the document includes:

object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\endofdoc"; // endofdoc is a predefined bookmark [code]......

which suggests something wrong with the bookmarks. So I took references to the bookmarks out and started using a file called Hello.doc as my template. No bookmarks - just the word 'hello' in it.This fell over too - but the StackTrace indicated it was when SaveAs was called.So, the question is ... why does it work on my development box but not on the server. The server has Word installed on it.

View 1 Replies

Finding Free Website For Uploading Testing Pages?

Feb 3, 2010

what free website can i upload my asp.net pages for testing?

View 4 Replies

VS 2005 - Finding IP Address Of The Person Who Is Viewing Pages

Feb 1, 2011

I want ip address of the person who is viewing my pages. I am using following code. But i am getting :::1

currently using code :-

string strHostName = System.Net.Dns.GetHostName();
string ip = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();

what is wrong or what i need to change?

View 6 Replies

Web Forms :: Finding Control Id And Setting Properties In Other Pages?

Oct 23, 2010

im using a webusercontrol (hide.ascx) it has 2 buttons btn_hide,btn_expand

and in my other forms of all like(products.aspx)customers.aspx,orders.aspx

im using a panel conrol(pnl_products) where in im placing all the input controls.

i want to find the panel control in hide.ascx page and to set that

panel.visble=true/false property in this page.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved