views:

63

answers:

1

Background / Disclaimer

First of all, please feel free to skip this entirely if you can understand the questions below.

I'm still very fresh new to .NET, but an elder monkey on bad old ASP in regular VB.

I just got into a company with some legacy .NET VB files and now I have a couple of huge projects, with over 50mb of files and about 1gb the whole project and debugging them haven't been easy. I've read through w3schools tutorial and did many google researchs to get to this point in which I just can't make this work. And unlike in another very similar question I don't think this is a simple issue.

I don't know if those projects are MVC or regular Web Application, but I was told to use "Other Project Types > Visual Studio Solution > Blank Solution" and then "Add Existing Web Site" to that. With no further instructions or orientation, I see they all have DLLs and makes me believe they are not MVC.

Anyway, whichever this or many other ways I've tried to add the files into Visual Studio, I could never use the Debug properly with one of them. One works fine enough, I can at least see it running locally very alike from the webserver. But the other gives me many random errors and warnings to "compile" the debug and run on Visual Studio's own server (I think it's called "ASP.NET Development Server"). Some errors shouldn't even exist like "The file XXX doesn't exist" while I can easily verify it does exist!

I don't really expect to have much help here, but I still hope to find some. Sorry if this is too much.

Questions

  • What options do I have to debug a big Visual Studio project that already works online in a server that have debugging and even error options turned off?
  • How can I know how to properly "import" an existing project into Visual Studio to begin with?
  • Is this a homework question?
  • (new) Given I have 3 places to sync many files (local, shared production network and live) what's the best approach to work on and debug existing errors? Out of the box thinking is always welcome (converting project, not using Visual Studio, older version, whatever)
+2  A: 

Sounds like you might be a little bit over your head. My first step would be to ask another dev there to help you out because you are in for a real learning ride.

Before I go any further, you are working from a local copy.. not the server one, right? If they have you browsing across the network to the server, then you need to stop that right now. Instead, copy all of the files to a local directory and work from it. Then go learn about publishing. Working directly off of the server is always a Bad Thing(tm). It screws with debugging and, more importantly, it's just plain wrong. Usually companies have some type of source or version control system in place. Use it. If it's not there, you might want to bring it up.

The Add Existing Web Site feature adds a Web Site project, not a Web Application or MVC app. These 3 things are very different from each other. I'm going to take a guess that you don't have an MVC app based on the age of the application.

The best way to tell the difference between the other 2 types is whether or not a .proj (project) file exists in the root of the site. If it is there, it is a web application. If not it is a web site.

For a Web Application
If it is a web application, look in the parent folder to see if there is a .sln (solution). If so, open that in visual studio.

If the .sln doesn't exist (or the project isn't in it) then you can create a new blank solution and click Add Existing Project. From there browse to the .proj file and add it.

At this point look in the Solution Explorer to see if you can find all of the files. Most likely, the missing ones are not included in the project. If you don't see them, then click on the "Show All Files" button at the top of the solution explorer. Then you locate them on, right click, and say add to project.

Web applications do not have edit and continue but do have a whole lot of other features which is why no one uses web sites anymore.

For a Web Site
Create the blank solution, then click Add Existing Web Site. Browse to the folder containing the site and click add.

Turning on debugging/errors
The debugging and error options are purely in the web.config. Just change your local config and run it again via F5.

One Final Note
I would highly suggest that once you determine whether this is a web site or web application and BEFORE you begin trying to debug this beast that you create your own web site/web application as a test. Find a tutorial on this, there are many. You might go to the asp.net site and watch their training videos.

Use that to build a couple web pages with navigation and maybe some database connectivity. It might take a couple days but you will learn a lot more before about .net in that time.

UPDATE FOR NEW QUESTION
Not just the Best, but really only place you should be debugging is off of your local copy. Debugging on a shared file set doesn't work to well (lots of security problems with network drives) never mind the fact that multiple devs might be working out of that shared area and debugging off of a live production server is a huge no-no.

Now some people might say that there are times when you have to debug in production. The reality is that issues found only in production fall into exactly two categories: 1. you aren't testing with the right data. - which means your test environment needs to be better. Or 2. it is an environment issue. The best way to solve #2 is to have a staging server which is absolutely identical to production which you do final testing on before pushing to live.

If you still think you have to debug in production, consider the impact of making a slight change which completely kills your site. Sure you can roll that change back quickly, but how many people did you just totally piss off. More importantly how many of them are customers and/or execs?

Which leads us to the final piece. If your project is a Web Site project, then go ahead and upgrade it to a Web Application project. When you deploy, you shouldn't be copying code out there. Instead, everything ought to be compiled.

Chris Lively
Hey Chris, thanks so much! I can't thank you enough to taking the time to write all this. Believe me, I've tried asking around - nobody have a clue. And yeah, I'm working from local, that far they could tell me, but I'd coincidentally do it even without anyone saying so, for other reasons. I was hoping you'd give options outside Visual Studio... I'm already hating it so much. :P Anyway, will try all you said and see what I can come up with! Thanks again!
Cawas
Having used other editors, Visual Studio is far and away the nicest one on the market. I would guess it's just different enough from the environment you are used to that you are already seeking alternatives. Just stick with it. There is nothing that comes close once you learn your way around. Good Luck!
Chris Lively
Also, if you start a new question with the exact error messages you are getting (transcribe them exactly) then we can probably help you through any of those debugging issues.
Chris Lively
@Chris in this context you get notification if I don't use @ mention, but I don't. ;) About "why Visual Studio sucks" ( http://www.google.com/search?q=%22why+visual+studio+sucks%22 ) there are too many reasons other than personal taste. Like this: http://www.andrewshough.com/development/the-one-reason-why-visual-studio-sucks/ I understand and I can see how it must be the most complex and complete code editor solution out there. But my personal issue with it includes .NET and the whole platform. After having superfically learned Python, Ruby, Java and .NET, I vow the later as the worst one.
Cawas
@Cawas: the thing Andrew went off on is about datasets.. Which have always been considered a very bad thing for a host of reasons. That's not really an issue with the editor, but rather a badly designed and poorly implemented early attempt at an ORM by Microsoft. Regardless, I wish you well on this project.
Chris Lively
Thanks again @Chris! I'll still come back with some feedback later on! ;)
Cawas
I've added a question there, hope you can edit your answer to clarify it to me as well. :D
Cawas
@Chris not exactly what I meant, but I'll just assume that's you brought up the only concern, and when developing .NET we should always use visual studio only, debug all localy, and then use either Publish or any other means to replicate / keep N number in snyc later on. I think this question is now oficially dead! :)
Cawas