made changes, compiled and regret - c#

I made today few changes by ctrl+h to all the solution.
When I understood my mistakes I tried to undo it with ctrl-Z but the results were awful.
The question is : How can I reload the last compiled project before I had done this stupid move.
Lets say I want the solution as it was at yesterday.
Thanks for your help,
Eliran.

you can try decompiling the old binary with tools like dotPeek. But in general that is the reason why you use a source control system.

You cannot. Once saved, the changes are irreversible. That's the point of backups. There are tools to decompile your .NET executable, but as not all sourcecode is actually compiled into the executable (for example formatting and comments are not), you will never get your original code back.
You may want to look into source control software like Git, Subversion or Team Foundation Server to handle this problem properly next time.

Related

Rebuilding Unity Project from DLLs?

I have lost my Unity project which was located on my hard drive. Fortunately, I have found some files that were associated with my project. See here.
Now, I have successfully converted Assembly-CSharp.dll into equivalent C# with a .NET Reflector but I can't find a way to rebuild my Unity project... (or at least a good part of it) How can I do this? Logically, the files that I have now are all we need to recreate the project.
Thank you for your help.
Please comment below if you wish the files to be uploaded.
My original Unity project (which I worked on for a few months) does transitions between menus, by touching, swiping, flicking, or pressing arrow buttons.
.NET Reflector: http://www.red-gate.com/products/dotnet-development/reflector/
You can recover all your scripts if you have the Assembly DLL, but nothing more. All the scenes, images, fonts, models, etc... are gone.
If anything, you can try decompiling the assets files and maybe you can recover some of those. For that you'll need special decompiling tools, such as disunity.
It's an experimental tool and has not been updated a lot since Unity 5 came out, but you can give it a try and maybe recover some files from your project.
Good luck with it !
The answer: NO. You simply cannot do this.
Unfortunately, I know this from experience. I ended up having my programming team hard-code values and have scripts programmatically attached to game objects in case the project was corrupted, so I COULD simply drag the scripts back into a new project and be half way there. It's a hard lesson learned.

Stetic GUI Designer Move to Glade for Gtk#3

I'm currently working at an audiobackend binding for my application. Since I want to use gstreamer, I found out, that I need to use GTK#3, because this is needed by gstreamer-sharp. Since I'm currently working with monodevelop, which uses stetic for GUI design, I wanted to ask, what is the best way, moving towards GTK#3. I see, that it uses .ui files for GUI definition, which can be generated by glade (I also tried a little bit around with glade). But my application has 4 windows with much code, so how can I easily transport this to GTK#3? Has anybody done this already?
Greeting
Sven
GtkBuilder works for both GTK2 and GTK3, Smuxi will eventually go that route and backport the GtkBuilder converted .ui files from Stetic back to GTK2.
The tool to convert the existing stetic UIs can be found here:
https://github.com/xDarkice/stetic2ui
Smuxi was a GTK2 app made with stetic too. When we did a Gnome .NET hackfest recently in Austria they found the problems you are talking about, but eventually solved them by using glade files and some clever approach to still be compatible with GTK2 and GTK3 at the same time, so you might want to look at their commits from September to November of 2013.

How to check in only some parts of the program in Visual Studio Team Services?

Additional info: I thought it might be helpful to say that my forms and classes are in the same solution as the already updated forms.
In our company we have this project which 3 people are working on it. One works on the database part, me and another colleague of mine are working on making the UI ready and relating it to database which is MS SQL Server 2012 and we are programming in C# in VS 2012.
The problem is that I made this one form ready, but the server version is ahead of me. That is, if I check in the whole program, I will damage the project as some forms has changed and the version I have is older. I tried right clicking and checking in only the forms and classes which I, myself made and I have their latest version. They check in without any error or anything, but the problem is, when my colleagues or myself(after deleting my source project) try to get latest version, my forms or classes doesn't show up.
We also tried to check in the whole program but only accept those pending changes which are made by me, still no success.
The problem is, we are kinda afraid to play with the server version as a lot of effort has gone into it.
Any help will be really appreciated as I'm stuck with this problem and the manager won't give me more parts of the program to make until we can come up with some way to deal with this.
You haven't mentioned merging at all but I think this is the answer to your question.
When you work on an older version of the code (because your local code is older, or maybe the whole branch of the code is older), you need to merge the code into the newer version. When you merge, any potential conflicts are detected and you can resolve all of them manually. There's obviously tools to help you - one is built into Visual Studio but you can replace it with an external tool which may work better for you. Either way, you need to decide how to merge the code. You have a few options:
take the whole code from the source (old code in this case),
take the whole code from the target (new code in this case),
merge the changes and take bits from each version based on your knowledge of the changes and how the code should look like.
As for why the forms don't show up, you probably didn't check in the changes to the project file so the new files are not part of the project as it exists in Team Services.

C# view source code of a particular .NET class

I browsed through some questions and this one stood out as the better one:
.Net Classes and their source code which pointed me to this place here: Microsoft Reference Source Server.
I tried everything the site says, downloaded a file that I cannot open from there and at some point ended up with a .pdb file in my source folder for the symbol cache that I could not open with a multitude of tools I looked into.
So this is my last resort to find an answer to my question. Out of pure curiosity (and lack of a better way to understand some stuff) I want to open a particular class from Microsoft (namely I wanna look into RichTextBox and maybe the classes it inherits from) but I simply cannot find a way to make this work for me. I want the original source, not a decompiler product because, well because I mainly need to understand some stuff, not see random variable names. I appreciate any help that may get me around my stupidity and clumsiness, as well as the right tools to do so (if any other than VS).
Note that I am using Visual Studio 2012 and yes, I went over a guide covering this specific version instead of the guide on VS 2008.
The "download" links on this page: http://referencesource.microsoft.com/netframework.aspx should work. However try downloading them via Internet Explorer; my Firefox attempted to download an .aspx file instead of the installer itself for some reason. (EDIT: as #ParagMeshram pointed out, just rename the netframework.aspx to netframework.msi as a quick fix if necessary)
In addition, here's a link to the source hosted by dotnetframework.org: http://www.dotnetframework.org/default.aspx/4#0/4#0/untmp/DEVDIV_TFS/Dev10/Releases/RTMRel/wpf/src/Framework/System/Windows/Controls/RichTextBox#cs/1305600/RichTextBox#cs
I can't say for certain if it's the latest greatest, or what you would be compiling against exactly, but should give you a good idea of how it works.

Visual Studio 2008 C# - Recover solution from application manifest possible?

Hello I recently deleted what I thought was an unused folder which happened to have the solution and code for a windows application I am maintaining.
I have published the app multiple times with ClickOnce and have access to the application manifest, deploy, etc. Is there a way for me to use the published application to get back my solution?
Thanks
If you don't currently use source control, I would highly recommend using one. I'm not aware of a way to get back all the solution files without source control, but you can get back the code using .NET Reflector. There is a file disassembler add-in which allows you to dump the code straight out of Reflector.
not possible. you can't recover the solution and original code from the compiled and deployed version.
if you have not used that machine or hard drive since you deleted it, you may be able to recover the files but it's a long shot and may be expensive.
you need to invest some time in learning source control. git, mercurial, subversion... they're all free and easy to use in windows. having your code in source control would prevent this problem - delete it all you want, just do a checkout from source control again.
Just go get the project back from Subversion.
Basically all you can do at this point is feed the assemblies to a program like reflector and reverse engineer it back. Welcome to sucksville.
If you don't have your stuff in some type of repository already I'd highly recommend fixing that first thing in the morning. With free tools like subversion available, nevermind things like TFS or even VSS there just isnt a good excuse.

Categories

Resources