Click here to Skip to main content
15,920,383 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
One of my projects displays ok in debug mode but the release .exe looks like an old version of windows with square buttons and odd 3d textboxes.
Posted
Updated 18-May-11 12:46pm
v2
Comments
Sandeep Mewara 18-May-11 10:33am    
Elaborate.
Dalek Dave 18-May-11 18:47pm    
It's not thate elaborate, it is quite plain actually...oh wait, I see...:)

The only time I've ran into this was when I was working on a Console application that was eventually ported up to a windows form application. I suspect that somewhere along the way the project did not have the "ENABLE VISUAL STYLES" option under project properties because it was originally a console app.

The way that I corrected this was to just recreate the solution [edit] & project file from scratch[/edit] and add in the exsiting code. Also, make sure that any time you do a build that has had massive code changes, always Clean, and Rebuild the solution.

[additonal]
I pulled up and older VB project and did some searching around and in the Application.Designer and found the following code.

VB
<Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
Public Sub New()
    MyBase.New( _
     Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
    Me.IsSingleInstance = false
    Me.EnableVisualStyles = true
    Me.SaveMySettingsOnExit = true
    Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub


I managed to recreate and restore a similar-acting issue by manipulating the properties below directly in the file and also through the IDE. After a few edits I eventually confused it.

VB
Me.SaveMySettingsOnExit = true 'false
Me.EnableVisualStyles = true 'false


The only thing I can think of that would cause a similar behavior that I did would be source-control check-ins check-outs.
[/additional]


Hope this helps,

-Artificer GM
 
Share this answer
 
v3
Comments
Eamon Carron 18-May-11 10:54am    
Thanks for the reply, I have tried reloading, cleaning and rebuilding. The project is a windows application and the display is ok when run in debug mode.
Sergey Alexandrovich Kryukov 18-May-11 16:29pm    
You're probably right, my 5 for your answer, but the problem is more general and deeper.
Please see my answer.
--SA
Try to delete all not-source files. First of all, delete sub-directories "obj" and "bin" and rebuild everything. The file extensions like "*.user", "*.ncb" and "*.suo" are also not source files. Let me note this: if you're not re-building everything from pure source code, you're in trouble, by many other reasons. If you're not using Revision Control System (where you would store only true source code), you're also in trouble. You really need to develop an accurate development cycle.

Good luck,
—SA
 
Share this answer
 
Comments
Eamon Carron 19-May-11 3:22am    
Tried you suggestions with no success. This is one of many projects written in c# vs2010. Out of desperation I created a new Windows Application Project, cut, pasted, add link etc from my problem project. After building my problem disappeared!
ArtificerGM 20-May-11 12:28pm    
That is exactly what I was trying to suggest.
Sergey Alexandrovich Kryukov 20-May-11 13:46pm    
I understand. Well, it could happen, too. Hard to say what could be damaged -- this time in project. Nearly anything. If shallow fix does not help a deep crunching could.
--SA
ArtificerGM 24-May-11 11:13am    
Check out the [additonal] information I posted.
Sergey Alexandrovich Kryukov 24-May-11 22:14pm    
Thank you for the note. I'll take a look.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900