Visual C# 2010 Express Edition Build Application Not Correct - visual-c#-express-2010

OK, so I am making a sample Tic-Tac-Toe game. I then go to build my application, and everything works correctly. I then go to make some changes, and the changes don't register. For example, I delete a button in the Form1.Designer file, but when I build it, it still shows the button I deleted. Or when I change the value of a int variable, it still shows the previous value upon building the application. This has happened multiple times, and I am really getting frustrated. Any help is appreciated.

Nvm, I figured it out. The problem was with the debug build, so I deleted it and rebuilt my program- and voila! It worked. If anyone else has this problem, navigate to your project folder and head over to the debug folder. Then delete the contents, and rebuild! It should work, as it did for me.

Related

visual layout editor does not allow drag&drop

I'am a newby in android studio and learning a lot, but now have a problem where i cannot seem to find the answer to.
In android studio you can visualy drag&drop your screen.
I have seen it can do al lot (although you sometimes need the xml) but for me it is not working at all.
I mean i cannot drag&drop any widgets on the screen at all.
Tried changing the theme: no help (really tried a lot of them)
Tried a complete new project: same story
Tried other APK verion: same story
Tried Invalidatd caches / restart: no help
Even with a new project (EmptyActivity) it add's a android.support.v4.widget.NestedScrollView and then gives error's on that
(Failed to find style 'coordinatorLayoutStyle' in current theme).
It also gives an error on layout_height/layout_with not being there. But they are there for each widget.
Please do not missunderstand: when i execute the project i runs just fine (both on phone and emulator) but the visual builder for the screen.....:-(
Does somebody knows how to solve this.
If more info is needed please ask.
Any help is more than welcome.
There are several things that could be causing this:
Your caches could be messed up. Try going to
File > Invalidate Caches / Restart ... (I know that you already tried this, but posting for future views.)
Also, make sure that you don't have Drag-n-Drop with ALT pressed only checked in your Settings (Appearance & Behavior - Appearance).
Finally, in a default project created in Android Studio, there are two XML files created for each layout. For example, content_main.xml is embedded within activity_main.xml. Make sure that you are using content_main.xml for your design work.
In the end i fixed it by changing the SDK version in de gradle file.
still do not understand why it was wrong as studio genereded it that way but now it works so.... for me: case closed.

Unable to package app on x64: Could not copy the file "obj\x64\Release\\project_name.xr.xml

I need help resolving the following error:
Error 2 Could not copy the file "obj\x64\Release\project_name.xr.xml" because it was not found.
NOTE:
This error does not occur when I package the same solution on x86.
This only occurs on x64.
In addition, this error is now exposed ever since I downloaded VS2012 Update 2.
The error went away as a result of me fixing the list of warnings that resulted from building the solution.
For me the issue was fixed simply by removing spaces from Assembly Name parameter. This can be found in the properties of the Windows 8.1 application project.
Ok, this is a weird problem and I could not solve it till I looked at the solution from Ken.
Click here for his solution
Ken's issue and solution gave me an idea and it worked.
I had x:Class="project_name.App" in my App.xaml file and Ken said the issue was with the app name.
So I removed the .App from x:Class="project_name.App" and just had x:Class="project_name" and received the error "Invalid value for 'project_name'. Event values must be text."
Ok so I put it back in.
Well, then it worked and the error went away.
Um, I do not have any idea why it now worked as it was exactly the same text, but the process of changing it back and forth fixed it. Hope this saves someone hours of pain.
And I am using Visual Studio 2013 Update 2 that I reinstalled onto my PC yesterday since the PC had a melt down and needed a rebuild.

Migrate Visual Studio 2012 Solutions to Another Server NOT Version

Actually quite a simple issue. I have been using a slow laptop to develop on VS2012, and I setup a screamer to develop on now. No change in versions, etc., just doing it all on a different machine.
To be honest, I haven't even copied the Projects folder yet, as I'm not sure if there wold be project-specific options that would be reset/broken.
To be clear, the new 2012 is Ultimate, and I haven't even tried to migrate. There have been a LOT of options/features added to my existing projects & solutions, so it may not be as simple as copy/paste the Projects folder.
What are your thoughts?
#Peter and #JohnnyHK,
You both were right. I was putting this off on a new machine for fear that I'd need to remember a ton of things I hadn't documented in the Solution (and projects under it-about 20).
So I was already using subversion on the old machine, so I added VisualSVN/Tortoise and checked out a copy of the solution to the new Projects folder. There were like 350 errors & more warnings! Yikes!
But I went through them very quickly and it is clean now. One thing that I noticed in the process was that VS2012 is a little 'broken' when it comes to project (on-web) references. NuGet was actually amazing in that as soon as I fired up the Package Console, it went along, finding & installing all the packages & dependencies! :)
I enabled Show All Files, then opened the References tree node, and noted the ones with little yellow "X"s next to them. In the good side, ones that were not needed (I added them, but created just clutter) were good to see & delete. BUT, there were mostly errors from references that had references to DLLs that were actually in the right place, and when I left clicked on the reference with the error icon, the error would simply go away. Weird, but preferable...
The strangest ones were reference to DLLs that were where they were supposed to be (I'd make a .\lib directory in the project, a la *NIX style, and throw all DLLs for that project in there), BUT I had to delete the reference in error (even though the project was pointing to the right file/location) and then re-browse for it, adding it again, and all errors went away.
All in all, I was pretty impressed with the ease-even with the weirdness-it went. Once I saw how the references were broken, I just went into each project & treated each one. Let me be clear for anyone doing a mass WPF migration: If I had started with the first project and worked to the end one, and ONLY fixed the References issues, I would have been done in 5 minutes-includes time for NuGet to auto-load.
I will not lie; This was the first big migration of a solution to a new machine, and when I saw like 700 warnings/errors, I thought "There goes another weekend!", but I will warn those in this situation to NOT go into source code and try to fix each red underline. You will break things!

Build does not work, need rebuild

This is really frustrating, I am using Visual Studio 2012 for C++ for a project, and it worked fine for a while. Then out of the blue, it started having problems.
The build function does not update the project anymore. I need to do a REBUILD every time I modify anything in my project.
I have looked all over for a solution, but none helped. First of all, I didn't change any settings, but I looked anyway. Tools/Options/Build&Run, Project/Config Manager, you name it I have checked it. It doesn't look like it's a settings problem.
Another thing though, on other forums, I have read that this MIGHT be because of a bad include, that the file included is not there anymore, or something like that. But that is not possible either since I didn't delete any file from the project. But, this problem seems more plausible since, the project at a much earlier stage, had less includes, and it still works.
So, can you help me solve this problem? It is really annoying since most of the solutions out there are NOT working!
Whenever I have run into an issue like this it is usually something like missing project dependencies. You may want to take a look at "Build Solution" not working in Visual C++ anymore. If you are able to share your solution someone may be able to take a look at it.

Android Studio-wont remember new edits and automatically reverts to old versions of files sometimes

Every once and a while I have an issue with the new Android Studio. Sometimes while editing, if I make a mistake in one of my files, then try to build it, Android studio will come back with some "Gradle" error. It will then automatically REVERT back to my original code (thus deleting any of my changes). I do not necessarily like this behavior, but I could deal with it.
However... sometimes, in the course of SAVING and editing, it gets into this weird state where Android Studio will REMEMBER the error, and wont let me correct it. I.e. it will keep restoring the OLD version of the file, with the error in it, no matter how many times I try to correct it and re-save it. An example of this is as follows. In the following XML document fragment, I mistakenly added the [android:backcolor="#00000000"] to one of my XML layout files...
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="#111"
android:background="?android:attr/activatedBackgroundIndicator"
android:backcolor="#00000000"
android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
After trying to build, Android Studio came back with the following error:
"Error:(1, -1) Gradle:No resource identifier found for attributed 'backcolor' in package 'android'.
Of course, I tried to simply DELETE the offending line that I added to return my code to its original state, before I added the line. I saved it (i.e. save-all/etc...) then tried to rebuild. To my dismay, Android Studio RESTORES the bad version, reinserting the erroneous [android:backcolor="#00000000"] line again back into the file.
I have also tried SAVING (save all) exiting out, going back in, the rebuilding it again, and just about every variation of this. Though the ONLY way that seems that will correct it sometimes is to completely exit out of Android Studio, start it back up again, and try again.
I am guessing that this is really a "feature" and has something to do with source control, and/or Gradle, and that I just don't fully understand it yet. I am also guessing that there is some setting somewhere to adjust and/or correct this - but I am clueless as to what is going on and what to do to fix it.
Is there a way to correct this annoying behavior of Android Studio?
I've had a similar issue when I make a mistake in my strings.xml file, for example when I have an apostrophe without preceding with a '\'. The trouble is that when the build fails, Android Studio automatically opens app\build\intermediates\res\merged\debug\values\values.xml to show me the broken string. If I then try to correct the string in that file, it doesn't do any good because when I try to rebuild, strings.xml is still broken. The crucial thing is to make sure that you're making the correction in strings.xml rather than the values.xml file.
I have the same issue, but i followed following steps and it resolved my issue,
1) Edit your layout file and open the same layout file in notepad, if you can see updated data in notepad then its Studio Synch issue. then re-synch project.
2) If your edited layout file is not reflecting new changes in notepad file then, first re-synch Studio project and followed step 1.
I hope this will resolved your issue as well.
I still have this issue, the only way I have found to fix it is to go to the terminal in android studio and run
rm -R app/build/intermediates/data-binding-layout-out
Android Studio is failing to delete the last build of the layout, when you try to compile again. Once you do it manually everything is back to normal.
While this issue still occasionally happens (as of currently the latest version is 0.5.+), a simple workaround is to manually edit the xml file with a text editor, then save it. Android Studio will then force resync those files.
To save the latest edits, click on the particular file in project window and select synchronize, and rebuild the code. then the latest edits will be saved.
I just had the same error and made me go crazy
I solved it by copying my project file to another directory and then importing it as a new project and the problem disappeared

Resources