locked
Unable to build because of errors, unable to fix errors because I can't build?! RRS feed

  • Question

  • User362498269 posted

    Hey all,

    Ok - this has had me stumped for a few days now, and I've just made it worse!

    I recently decided to make some changes to some code in a project, these changes effected various other areas of the project and generated over 100 errors.  I started working through them.  During the process it was necessary to create some new objects.

    This is where it all started to go wrong...

    The new objects just dont seem to get "seen" by Visual Studio, ie, I can create a new class, but, sometimes, if I enter:

    Public Sub New()

    and hit enter, it doesn't create the End Sub part for example....

    In addition, if I do manage to create the object (rare), when I then try to use it in other areas of the project, it just doesn't have a clue what it is... it either underlines it saying there's no definition, or, it just lets me type in whatever without underlining anything at all, almost as if I've reached a threshold on the error count or something...

    To make matters worse, I had the great idea today of excluding the troublesome files which contain the bulk of the errors from the project in order to fix a few, enough to build, then, include the excluded files again so that they would see the objects... unfortunately, this blew up in my face like an explosive bag of pooh... once I'd excluded the objects, and then tried to reinclude them, it then didn't know what any of those objects were either...!!!

    To say I am pulling my hair out would be an understatement... I seem to be stuck in a cyclic environment... One where I cant build because of errors, and I cant fix the errors because I cant build... as such I'm at a total loss...

    *ANY* help with this would be gratefully received... I have been working on this project for 3.5 years now and theres still a long way to go, its been plagued by various problems along the way... but this one I just have no idea how to resolve...

    Kind regards

    Rob 

    Monday, March 8, 2010 11:10 AM

Answers

  • User-990694832 posted

     There is a project build order / dependency tab in the solution/project propery page.   Most of the time vs gets the build order correct but in your case sounds like a tweek needs to be made.

    Or a person could temperarly comment out the new objects to get a propper build.

     

    Hope this helps

    DK

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 10, 2010 3:21 PM
  • User-952121411 posted

    Unfortunately there is going to be that (1) 'answer' for your issue, but rather some given advice, as the issues are too broad and many to be able to solve on a single post here.

    1st off it sounds like you may have a massive project that has been worked on for several years, correct?  With this amount of work I would expect you to be familiar with VS.NET and how to organize your projects in the solution.  Can you elude to the physical structure within your solution?  How many projects comprise your solution?  Do you have them all properly depending on each other where needed?

    Also what IDE are you using?  VS.NET 2008?  If yes, make sure you have SP1 installed as there were some issues in the primary release.  When you state the following:

    but, sometimes, if I enter:

    Public Sub New()

    and hit enter, it doesn't create the End Sub part for example....

     

    ...that to me sounds like an IDE issue and not a coding problem.  Regardless of the number of errors, VS.NET should be completing statements (assuming properly entered and spelled correctly) without issue.

    Also 'Clean' the project, and then manually delete all built files from the /bin directory to make sure there are no old lingering files.  Also, if you have recently copied and pasted your entire solution to another location, make sure the 'bin' and 'obj' folders don't have any files within that are marked 'read-only' that can not be overwritten when built.  VS.NET gets in a real mess if it can not 'Clean' (delete) and then re-add the binaries back into the bin.

    Lastly, be organized.  If the project is extremely large, make sure you have files, projects, folders, named well and organized properly so as not to get into a big mess like this.  One final solution might be to create a brand new fresh Solution in VS.NET, and begin to import the projects and files in 1 at a time, making sure each one builds before adding back in the next project.  At this time you could rename projects/files etc. to help keep things organized.

    Good luck, and hope this helps! Laughing

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 11, 2010 2:23 PM

All replies

  • User-990694832 posted

     There is a project build order / dependency tab in the solution/project propery page.   Most of the time vs gets the build order correct but in your case sounds like a tweek needs to be made.

    Or a person could temperarly comment out the new objects to get a propper build.

     

    Hope this helps

    DK

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 10, 2010 3:21 PM
  • User-952121411 posted

    Unfortunately there is going to be that (1) 'answer' for your issue, but rather some given advice, as the issues are too broad and many to be able to solve on a single post here.

    1st off it sounds like you may have a massive project that has been worked on for several years, correct?  With this amount of work I would expect you to be familiar with VS.NET and how to organize your projects in the solution.  Can you elude to the physical structure within your solution?  How many projects comprise your solution?  Do you have them all properly depending on each other where needed?

    Also what IDE are you using?  VS.NET 2008?  If yes, make sure you have SP1 installed as there were some issues in the primary release.  When you state the following:

    but, sometimes, if I enter:

    Public Sub New()

    and hit enter, it doesn't create the End Sub part for example....

     

    ...that to me sounds like an IDE issue and not a coding problem.  Regardless of the number of errors, VS.NET should be completing statements (assuming properly entered and spelled correctly) without issue.

    Also 'Clean' the project, and then manually delete all built files from the /bin directory to make sure there are no old lingering files.  Also, if you have recently copied and pasted your entire solution to another location, make sure the 'bin' and 'obj' folders don't have any files within that are marked 'read-only' that can not be overwritten when built.  VS.NET gets in a real mess if it can not 'Clean' (delete) and then re-add the binaries back into the bin.

    Lastly, be organized.  If the project is extremely large, make sure you have files, projects, folders, named well and organized properly so as not to get into a big mess like this.  One final solution might be to create a brand new fresh Solution in VS.NET, and begin to import the projects and files in 1 at a time, making sure each one builds before adding back in the next project.  At this time you could rename projects/files etc. to help keep things organized.

    Good luck, and hope this helps! Laughing

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 11, 2010 2:23 PM