简体   繁体   中英

Unable to debug .NET web application with VS2010

This is a long shot, but I'm stressed out of my mind trying to figure this out. I can't provide significant amounts of source due to my NDA, but I'll try to give as much as I can.

I've been asked to make changes to one of our web applications. I'm at an international company and I've never worked on anything this large-scale before (I'm relatively fresh out of college), so it's a little overwhelming by nature, but what makes it ten times worse is that I can't debug the application!

When I click my friendly green arrow, I'm greeted with several errors (circular references and missing references, typically in .master files).

The part that doesn't make sense to me is that our contractors continue to modify and debug our application every single day. There must be something I'm doing wrong. When I asked them to show me how to begin the debugging process, they adamantly refused, essentially claiming it was a trade secret. This seems at best a case of dubious ethics and at worst a potential lawsuit and violation of our contract with them, but that's for another story.

I have a feeling it's a very quick solution, but my searches have turned up nothing.

We also have a second web application that was touched by a different company, and I can't compile that project either, though with different errors. The professionals appear to know some trick that I do not.

What's also frustrating is that this situation has made me look like a totally incompetent CS grad to my non-programming manager. I know how to use the Debugger, and I know C#/.NET, but I'm at a roadblock, and I'm the only programmer at my company (so internal help is out of the question).

Can anyone help me out? I'll provide limited source if needed.

Edit 1 - A brief list of unique errors is below. I've replaced sensitive information with wildcards.


'*tools_master' does not contain a definition for 'btnSave_onClick' and no extension method 'btnSave_onClick' accepting a first argument of type '*tools_master' could be found (are you missing a using directive or an assembly reference?) | *tools.master

Circular file references are not allowed. | *\\App_Master\\Account.Master

Could not load type '*AddressDisplay'. | *AddressDisplay.ascx

Unknown server tag '*:LeftNav'. | *App_Master*Home*.Master


Edit 2 - In addition, the site builds and deploys just fine. It's only debugging that errors show up.

Edit 3 - I've managed to fix the circular reference errors thanks to Kash's response. The rest will have to wait until at least tomorrow.

Have you tried rebuilding the entire solution in Debug mode? You should see these errors there.

Each of these errors have multiple causes. My advice would be to take each one separately and research. One solution would usually fix the others.


The first error:

'*tools_master' does not contain a definition for 'btnSave_onClick' and no extension method 'btnSave_onClick' accepting a first argument of type '*tools_master' could be found (are you missing a using directive or an assembly reference?) | *tools.master

Master pages can be tricky. Try removing the button and adding it again. Also try checking the Codebehind and the MasterPageFile attributes of the Page directive. Eg,

<%@ Page Title="" Language="C#" MasterPageFile="~/PageTemplate.Master" 
AutoEventWireup="true" CodeBehind="NewTransport.aspx.cs" 
Inherits="ASPDU1.NewTransport" %>

The 2nd and the 3rd errors:

Circular file references are not allowed. | *\\App_Master\\Account.Master Could not load type '*AddressDisplay'. | *AddressDisplay.ascx

This usually happens when you have a usercontrol on a master page. Numerous suggestions on StackOverflow itself.


The 4th error:

Unknown server tag '*:LeftNav'. | App_Master Home*.Master

This usually means that you do not have a .NET component or a 3rd party .NET library installed. Are you using Sharepoint or Telerik controls?

Are you able to successfully build this application? It doesn't sounds like you are. That would be my first priority because I wouldn't know how to debug if the program doesn't compile or build.

Recommend you try a "hello world" console application or likewise and see if your debug works with that.

More specifics would be appreciated if you'd like to get to the bottom of this. Could you include some of the steps you've taken so far?

It seems that your project is having lots of references to organizational defined DLLs etc. If it is saying ***are you missing a using directive or an assembly reference? then it looks like your machine's GAC or your project might be missing some references (may be organizations standards) that by default are there on everybody else's machine who have installed those components.

sflancer06 -

If I understand correctly, you can Start Without Debugging ... but you cannot Debug ... is that correct?

Is it possible you have extra files?

I've experienced tremendous grief myself when people re-name a file (default.aspx.cs becomes default.aspx.old) but don't actually remove it or exclude it from the project.

(ie Sometimes you have two files with the same class name.)

Are you using a Web Site or Web Application?

Are you sure you have a 'clean' project/solution?

Regards,

Glen J Fergo

You are coming in at a disadvantage if you cannot get your project to build.. Having been in this situation before, I would recommend you work with your consultants to get you into a situation where your project builds successfully. They will be familiar with the nuances in the project to get it to build.

Remarking out lines is a red herring, because the root of your problem (my educated guess) is that either you are missing assembly references in your project, or you don't have the latest version of the source. Working with your co-workers/consultants is the best way to resolve that.

Only once you have complete knowledge of how the application works are you then at a position to start replacing functionality. Although this isn't a solution per se, it may be the best answer you could hear, since it will get you moving forward.

Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM