Hallo all,
I made some revisions on a c sharp file in visual studio 2008 express, and committed the following actions:
1. open this c sharp file thru notepad,
2. tried to save some modifications in this file while it was opened by the notepad,
3. Ctrl+C and Ctrl+V to make a copy to this file
4. closed visual studio 2008 and notepad
Then this c sharp file dissappears! Please help!
John
It's gone forever. The only thing you can really hope for is to pair the situation with the appropriate whiskey.
If it was months of work down the drain, I would choose Ancient Age out of the plastic bottle.
if you right click in your project and then goto add existing you should be able to re-add it.
As to why it disapears i am not sure ... i guess it may be a file handle problem.
Is there a repository, a version control system, or something like that? Otherwise, let your code RIP.
Sounds like it has probably gone forever, but you should be able to recover it from your daily backups. You do take daily backups don't you....?
Related
as a starter of c# (And honestly not really loving the visual express c# environment) I'm in need of a back-up function to finish off my program.
I have 4 xml files in the /Data folder (In my project's root)
Now, what I want to do is back these files up in a file-save sense.
When a user clicks the "Back-up 1.xml!" button I want the program to open a saveDialog which automatically saves a pre-defined XML file (/Data/1.xml), to wherever the user wants, under whatever name the user wants.
However, I just cannot get googled how to make c# preselect that file. I only get these plugins from MSDN (which isn't very usefull either)
Any help would be appreciated, thanks in advance!
It looks like you need to copy a file from one location to another one.
Here is another StackOverflow thread that looks similarly to yours:
Copy a File
Esentially, the only thing you need to do:
System.IO.File.Copy(oldPathAndName, newPathAndName);
You can get newPathAndName from user input. You know oldPathAndName already.
Few hours ago I started a new project. I pretty much finished it up, but I was making some performance tests with it. During those tests my PC suddenly crashed, so I needed to restart it.
After reboot, when I open my project, my main .cs file doesn't want to open! When I click on it in visual studio, it opens a blank notepad file! How do I retrieve my code from that file? Almost all of my code was in it...
Seems like it is not a VS related question but file recovery based one.
If you ever saved your file, chances are that you can recover them. Winhex is a good tool to recover deleted files. Here is how.
If you never saved, chances are very bleak.
I have same problem few days ago. My PC restart suddenly and all file that is opened in VS is no longer work.
Try to open this file in Sublime text and Notepad++. If this will open file then you can copy it otherwise their is no way to read that stream that is look like $$%%$%%$#^%#^$
What I do is coding back from backup copy and spent my few more hour to recover my work by doing it again.
I believe if your code is personal then you should backup it or try private git (bitbucket,github) somewhere so you can easily get your thing back instead of 100% total lose of data.
I have Microsoft Visual C# 2010 Express edition, and every time I open it it makes a new folder in My Documents. Problem is, I want to reserve My Documents for, you know, actual documents. I managed to redirect most of the stuff in the folder into another place by changing the settings, but a folder called StartPages stays, no matter what. After some research I found I have to change something in the registry, which I can't seem to find. I researched into that and apparently I need to create a new Setup Project or something, which I also can't seem to find. I have no idea what I'm doing at the moment, so any advice would be appreciated.
(I have a bit of OCD when it comes to organizing my files the way I want, so if I can't get this to work I might go crazy). Thank you.
Go to Options in the Tools menu, select the Projects and Solutions -> General option group. The top item in that group of options should be the default project location. Change that to wherever you want your projects to go by default.
You might also need to change the other two directories in that option group.
This is based on VS2010 Pro version. If it's not there in Express, let me know and I'll have another look at it.
--
Except you've already done that. Sorry, wasn't paying attention as well as I should be.
If you can't find the registry entry to change, you could try turning off the Start Page completely. Personally I've never found it useful, so I turned it off shortly after installing VS2010.
In Tools->Options->Environment->Startup change the At startup option to Show empty environment. This disables the Start Page functionality, which also stops VS from executing the code that is creating the StartPages folder.
The registry path for Express editions is different to the Pro edition, and I don't have a VS2010 Express installed here at the moment to look at. Try searching for the value VisualStudioLocation in RegEdit, and change any value in that registry key that uses %USERPROFILE%\Documents to point to somewhere else.
I would like activity in my Visual C# 2008 Express to not appear in My Recent Documents (I use Windows XP). To clarify, when you open a solution or other file in Visual C#, a link to that solution or other file is added to "My Recent Documents". I would like that not to happen.
How can that be achieved?
I know there's a chance this question is better fit for one of SO's sister sites, but my best judgment was that it fits here...
Thanks
I know there is a away of stopping Windows from updating the list, but I don't believe there is a way to stop it from updating for certain file types.
I way you may be able to do it with is to use batch scripting.
cd "C:\Documents and Settings\PROFILE_NAME\Recent"
del *.<C# file extension or other project extensions>
...
del *.<C# file extension or other project extensions>
Create the file using Notepad and save it as <any name>.bat.
After you work with you C# project you just run this Batch script and it will remove all your evidence from your My Recent Documents folder.
NOTE: If you can't access the Recent folder (because it's hidden) try replacing Recent with My Recent Documents
Thanks
link textI've added this functionality to Visual Studio MRU editor.
The list of extensions is currently fixed, and it needs to be roughened out.
The new prelimenary executable can be downloaded here.
... and the Sources, in case you don't trust me ;)
(I'm not sure if I should keep the separate "save" handling - it was a good idea during testing, but otherwise is rather annoying).
I am currently developing with VisualStudio 2008. I find it increasingly difficult to find files when the number of files and projects increase. The situation become so bad that I literally have to spend 10-20 seconds to find code I want to work on when switch between files. Sounds like not a lot of time, but this can be very annoying because it breaks the "coding flow".
I believe this is a general problem with all IDEs. But I still find it easier to work with Eclipse. One particular example is that in Eclipse, I could apply some key shortcut to find implementations defined in an Interface.(I have forgotten which key shortcut though, after not working with it for about 1 year.) Another example is that in VS 2008, rightclick->Find all references will find all occurrences containing the selected text(Update: This accusation is incorrect. Thanks for pointing it out); while similar operation in Eclipse will find all occurrences where the selected class/variable are referenced. Personally, I find the Eclipse way is better for file navigation.
This could be due to my inexperience with VS IDE. So, I am looking for suggestions to improve the file navigation experience so that I can get some more time for actual coding.
I have used the navigate buttons but they are only useful for small number of files.
Thanks.
I agree wholeheartedly about ReSharper. If you don't want a "paid" solution though, a useful Visual Studio shortcut is
CTRL + ,
it gives a list of recently edited files.
CodeRush is a free alternative to ReSharper which you might find useful too.
Kindness,
Dan
Have a look at Jetbrains Resharper. Ctrl N or Ctrl Shift N. To jump quickly to files by type name or by file name. Also you can control Click Classes to navigate to them instantly.
I can't even work in visual studio without it anymore. It virtually eliminates the need for the solution explorer
SamTools for Visual Studio 2005/2008 (and I have a build for 2010 if someone needs it). The particular feature that's handy here is the Solution File List.
You can right click the tab of any open document and Find In Solution Explorer or Show In Windows Explorer
You can right click in the Solution File List for the same
Unlike other solutions to this problem, this is a properly docking tool pane so it fits in great. Ctrl+Alt+F places you in the Filter box with the current text selected, so it's very easy to work with.
Oh and it's free/GPL. :)
Solution File List http://wiki.pixelminegames.com/images/8/88/SamTools_SlnFileList.png
Dpack is also a free alternative with some nice file navigation shortcuts, but Resharper is the bomb.
BTW, they should have some more of this stuff in vs2010, which is in beta right now (I think)