Solved

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

Posted on 2015-01-12
16
161 Views
Last Modified: 2015-01-13
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.
0
Comment
Question by:taz8020
  • 7
  • 7
  • 2
16 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40544184
>>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
 
LVL 30

Expert Comment

by:Zoppo
ID: 40544222
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
 
LVL 3

Author Comment

by:taz8020
ID: 40544229
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
 
LVL 3

Author Comment

by:taz8020
ID: 40544447
its not any deleted or modified files any other ideas. Most of the time its requires 2 builds sometimes 3.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40544467
Are there multiple projects in the solution.  If there are then check the build / dependency order
0
 
LVL 3

Author Comment

by:taz8020
ID: 40544522
yes  there is, but where and how do I do that?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40544544
Which language are you coding in?
0
 
LVL 3

Author Comment

by:taz8020
ID: 40544549
vb.net
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40544567
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
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40544571
For VB.net the dialog should be pretty similar if not the same.
0
 
LVL 3

Author Comment

by:taz8020
ID: 40546163
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
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40546170
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
 
LVL 3

Author Comment

by:taz8020
ID: 40546365
when you say import do you mean add existing project? if so tried this and get the same problem.
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 40546487
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
 
LVL 30

Expert Comment

by:Zoppo
ID: 40546509
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
 
LVL 3

Author Closing Comment

by:taz8020
ID: 40547321
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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now