views:

1379

answers:

4

Hi- I've added a label control to a webform. It appears when I run the page but when I try to reference it using the codebehind, I get no intellisense and the code I write somehow doesn't work. I've verified the project is running in debug, that debug compilation is set in the web.config. In fact, I can debug all pages. However, when i go to this page, debugging runs over it as if there is no breakpoint set. Also, on the breakpoint, it says 'The breakpoint will currently not be hit. The source code is different from the current code' which has the be the main issue. Not sure why that's happening as I recompiled the whole project.

I have this at the top of the page:

print("<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberSearch.aspx.cs" Inherits="Portal.EmployerPortal.MemberSearch" Debug="true" %> ");

Any ideas?

+1  A: 

Try doing a Build -> Clean Solution

GlitterMonkey
I don't have the option 'Clean Solution'. Is there something I need to do to make it appear?
asp316
+2  A: 

In the past I've had problems with this because the auto-generated designer files were bad. Try deleting them and then allow VS to recreate them, this may fix the problem.

Jason
I deleted the designer file and that fixed the intellisense problem. Thanks!When debugging, I still have issues getting a breakpoint to hit. It still says 'The breakpoint will currently not be hit. The source code is different from the current code'. Ideas?
asp316
Delete the pdb's.
Robert C. Barth
A: 

Something similar happens to me from time to time...I add a control and I get no intellisense...VS basically has no idea the control is on the page/designer. If I close the file (codebehind and HTML) and come back...everything is honky dory. Clunky, but it works. Worth a try. I'm using 2008 BTW.

A: 

This is a common problem with VS. Usually the cause is the .designer files are not re-generated due some sort of layout problems.

After deleting the .designer file right-click on the project name in the Solution Explorer and select Convert To Web Application.

If this is not helping either read the following article for more information.

J Pollack