Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why can't I add code to a C# project in Visual Studio 2008

Posted on 2010-11-29
6
Medium Priority
?
320 Views
Last Modified: 2013-12-17
I have an intermittent problem with visual studio 2008.  I will work on a project for a period of time (not sure if length of time matters) but sometimes I will add code to a project and that code doesn't get incorporated into the project, it's there, it's saved, but it doesn't affect the behavior of the code.  

For example, today I have a project that is working, but I wanted to add a simple switch statement.  I added it, but the changes didn't appear in my results when I run the code in debug.  So I added a writeline statement inside the switch and still nothing.  I have encountered this behavior before and I have had to create a new project and paste the old code into it, at which time the changes are recognized.

Has anyone else encountered this?  Any idea how to fix?
0
Comment
Question by:rickmatt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:rickmatt
ID: 34230476
Also, I noticed that the new code is recognized if I switch from debug to release, but when I switch back to debug, the code is still there in the .cs file, but it doesn't get included in the run.
0
 
LVL 15

Accepted Solution

by:
crisco96 earned 1000 total points
ID: 34230508
I've never seen anything like this happen. Next time it happens try deleting your bin folder and rebuild and see if that fixes it. It almost seems like VS doesn't recompile the executable sometimes. Also double check that you don't have any compile errors when this happens.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34230510
You don't have any #if DEBUG blocks in there do you?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Expert Comment

by:TonyReba
ID: 34230535
can you post your page first lines , that sounds kinda odd, have you rebuild the solution and right click into the code file to manually add???
0
 
LVL 6

Expert Comment

by:ajb2222
ID: 34230563
Under the build menu, select rebuild solution then run it.  

0
 

Author Closing Comment

by:rickmatt
ID: 34230588
Awesome, that worked.  I never considered deleting the bin/Debug directory before, and it's a tiny bit of a hassle, but much better than rebuilding the entire project as I had done before.

Thanks for the quick solution!
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

670 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