Solved

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

Posted on 2015-01-12
16
171 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 31

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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
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
 
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 31

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Example works but why do I need to click twice on button 4 48
VB.NET 2008 Publish Error 2 34
Help with opening combobox using VB.NET. 3 25
FInd Image Control Gridview 3 21
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

856 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