views:

65

answers:

3

Hello everyone, Ive had this problem multiple times and it ruins my projects, I make some changes, like say I have a button in the top left corner of the form and move it to the top right corner, then I press debug but nothing happens to the form, it doesn't change the button is still in the top left-hand corner instead of the top right, and it also doesn't except any new code, its like it saved the project right there and won't move on. Does any one know why or had this problem before?

Please, Help!!!!

Additional Details: Compiler: Microsoft Visual C# 2008 Express Edition I once fixed this problem by rebuilding the solution, but its never worked again.

A: 

In the Visual Studio settings under Projects and Solutions->Build and Run change the option On Run, when projects are out of date: from Never Build to Always Build

Tools > Options > Projects and Solutions > Build and Run > On Run, when projects are out of date: "Always Build"

SwDevMan81
Im not using Visual Studio, Im using Microsoft Visual C# 2008 Express Edition and I can't find that setting EDIT: OK, I found it but it didn't work.
Tanner
In express versions of VS there's a "show all options" checkbox in the bottom corner of the options dialog. Make sure that's checked. (Don't get me started on why that checkbox exists)
Josh Sterling
@Tanner: You're using Visual Studio; Visual C# Express (regardless of the version) is just a copy of Visual Studio that supports only C# and doesn't have the full feature set.
Adam Robinson
I did what SwDevMan81 said it but it still didn't work.
Tanner
I'm assuming there arent any errors, correct. If there is an the setting for 'On Run, when build or deployment errors occur' is set to 'Launch old version', it might look like nothing is changing.
SwDevMan81
There is one warning that says "Unspecified error" and its set to "Prompt to Launch"
Tanner
Does Debug vs Release mode make a difference?
SwDevMan81
Umm release mode? IDK what that is but, if I press Ctrl-F5 or start without debugging it works fine with all the features changed
Tanner
In the Build menu, select 'Configuration Manager', Then make sure all projects under the Debug/Release drop down for 'Active solution configuration', that the Build checkbox is checked.
SwDevMan81
A: 

In addition to @SwDevMan81's answer with whom I agree, I would say that setting both the output and reference paths may help avoid such behaviour for class libraries. For instance, your application references a class library that you are currently writing, and you perform some changes to this referenced library, but the changes don't show.

What happens is that the compiler will copy localy (to the project's output directory) thereferenced DLL and as long as it is there, it won't get updated. You may verify it by clicking right on the referenced assembly, then clicking Properties. Look at the Filepath property. If you see it doesn't match your actual filepath, then you will have to make sure to set the reference path accordingly in the project properties, then removing then removing the actual reference to add it where the actual build is, that is, where your class library output folder is set. So, whenever you regenerate your class library, your application gets the update automatically. Here's an example:

Application Project references : The ClassLibrary1.dll assembly.

Once you will generate your application, the ClassLibrary1.dll file will be copied to your application output directory. Let's suppose C:\Open\Projects\ApplicationProject1\Debug\bin. So, this directory will now contain the ClassLibrary1.dll file.

  1. You rewrite a method to behave completely differently;
  2. You regenerate the ClassLibrary1 assembly;
  3. You rerun your application (remember that the file already exists!);
  4. Ends up wondering why the changes didn't take effect? That is because your application referenced the cached assembly within its Debug\bin folder.

To workaround:

  1. Remove the assembly reference from your application project;
  2. Go to the project's properties and click the Reference Path tab;
  3. Browse to your ClassLibrary1 output folder, then open it;
  4. Your Reference Path property is now set for this library, then re-add the ClassLibrary1 assembly to your application project;
  5. Run once, stop running, and see if the Path property of your referenced assembly is still the same as the one in the project's Reference Path property;
  6. You're done (if everything worked fine). C:\Open\Projects\ClassLibrary1\Debug\bin\ClassLibrary1.dll

In the end, this might be the cause of your problem if your GUI Forms are part of a class library, and the solution I described should work.

Will Marcouiller
I really don't understand, I have no ClassLibrary1.
Tanner
What does your solution look like? Can you post some sample code in order to show us?
Will Marcouiller
+1  A: 

Hey, I got it fixed, I right clicked Form1 in the solution explorer, clicked properties and change the Build Action to none then back to Compile and it seems to be working.

Tanner