Visual Studio does not show my win form app on first build

Visual Studio is no longer showing my app on first build. I have to do a build sometimes 2 or 3 times before it shows my app. It was all working fine but then I stupidly not do a backup for 2 months and then used find and replace (never do that again). I went through the code and changed them all back or I think all of them. But now when ever I change any code I have to build it 2 or 3 times before it will show my app. Once it does show it the win form app it all works fine.

Please help this is driving me mad.
LVL 3
taz8020Asked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
Add existing project - yes.
hmmm  :-(

Next step is to create a new solution and then an empty project and import individual files into that project.  Repeat for each project you have.  Rather more work and if it doesn't cure it then I am at a loss as to what is happening.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>But now when ever I change any code I have to build it 2 or 3 times before it will show my app.

Does the build fail and you make corrections or do you just press build a few times in succession (without changing anything) and then suddenly it will work?
0
 
ZoppoCommented:
Hi taz8020,

most probably for any reason VS thinks one or more output files aren't up to date. Did you try a Clean or Rebuild All? It even could be a file which is deleted on disk but still present in the project leads to such a beahvior. Or possibly a file with a creation/modification date in the future could cause such a problem too I think.

ZOPPO
0
Managing Security & Risk at the Speed of Business

Gartner Research VP, Neil McDonald & AlgoSec CTO, Prof. Avishai Wool, discuss the business-driven approach to automated security policy management, its benefits and how to align security policy management with business processes to address today's security challenges.

 
taz8020Author Commented:
I don't get any build errors I press build a few times in succession (without changing anything) and then suddenly it will work. I did try the build and rebuild will look to see if there are any files no longer on disk.
0
 
taz8020Author Commented:
its not any deleted or modified files any other ideas. Most of the time its requires 2 builds sometimes 3.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Are there multiple projects in the solution.  If there are then check the build / dependency order
0
 
taz8020Author Commented:
yes  there is, but where and how do I do that?
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Which language are you coding in?
0
 
taz8020Author Commented:
vb.net
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
This is with C# In VS 2010.  
Project menu : Project dependencies.
You then get a dialog with two tabs, dependencies and build order.
On the dependencies tab you can select a project in the combo then click the other projects it depends upon.
build order
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
For VB.net the dialog should be pretty similar if not the same.
0
 
taz8020Author Commented:
Checked that and still does not work first time, its driving me mad. The first time you build you can see it building and takes about 40sec to build. but the second time as its built it takes seconds. Any other ideas?

All other projects open fine its just this one which has four internal projects.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Create a new solution and import the projects into it.  That should be done pretty quickly and, with luck, it will cure the problem.
0
 
taz8020Author Commented:
when you say import do you mean add existing project? if so tried this and get the same problem.
0
 
ZoppoCommented:
Maybe you can find out what goes wrong by turning on Visual Sutdios system logging - here you can find how this can be done: http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx

When you have configured this you should do a RebuildAll followed by F5 and analyze the log output.
0
 
taz8020Author Commented:
Well I seem now to have other problems but the one I asked about is sort of fixed. In this project there is about 400 forms the logs look fine but after going through page by page I do get a cross thread error on the splash screen. What is confusing is its on the same thread. its just a line of code that sets the theme but once I comment it out its works fine and in my main project. Have other issues now but as they are different will ask on another thread tomorrow. Thank you for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.