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.
Related
I am developing a Chess Game in Unity. I am not writing the AI by myself but using the chess engine named MadChess.
I downloaded the source code of the engine(which is written in C#) as well as the executable file named "MadChess.exe"(which is basically a command prompt through which we can talk with the engine following UCI protocols)
I haven't actually integrated a chess engine with a unity project before and also not able to find many resources online on how to do it.
Approach 1:
Initially, I wrote a C# script in Unity which creates a separate process to communicate with "MadChess.exe" but I later realized that the approach is buggy. This is because when I build my Unity Project as a standalone application for Windows, it is dependent on the physical "MadChess.exe" file located on my PC i.e. it doesn't build everything(My Unity Project code along with the Chess Engine Code) together into a single executable application. This according to me is faulty and can only be rectified by creating an installer of the game which injects the "MadChess.exe" file along with my main Unity code.
Approach 2:
Now, I am trying to go through the source code of MadChess chess engine project and basically creating .dll files of the chess engine project which I plan to use as plugins in my Unity project. I would interface with them through my C# code in Unity eventually. Is it the correct way or not?
I am stuck at this for around a week or so and still not able to find a clear way. I don't want to spend another week just to realize that I am doing it wrong. Even if I am wrong from the start please let me know. I simply want to integrate a Chess Engine with my Unity Project. If someone has any suggestions or ideas or if someone has done this before please guide me. I would be grateful. Thanks for bearing with me till here.
I recommend using Approach 1
Both approaches sound valid, but I recommend using Approach 1 to communicate with MadChess.exe as a process, because this is much less work than Approach 2, especially if you already have the first approach working (aside from the build issue).
Also, aside from the source code, if the MadChess project is only providing the exe and not the dll files, then I think it's safer to stick with the approach that is implicitly "recommended" by the project. You don't know what kinds of issues you'll run into when you try to make the dll files yourself (and it sounds like you have been running into issues already).
Even though it should be possible to use dll files, I think it's preferable to pick the approach that will let you progress on your project faster. You can always switch to Approach 2 later if you run into other issues.
(Just make sure to show appropriate errors in case MadChess.exe is not found, so that you can troubleshoot issues quickly.)
How to include MadChess.exe as part of your build
You don't necessarily need an installer to include the MadChess.exe file with your game. You can also copy MadChess.exe as part of the Build Player Pipeline. Using either BuildPipeline.BuildPlayer or the PostProcessBuildAttribute, you can get the path of the built project, and then use FileUtil.CopyFileOrDirectory to copy MadChess.exe during the build step.
Also, as #AdrianSgro mentioned in a comment, StreamingAssets works as well. (But note that the documentation explicitly mentions that .dll files in this folder are not included if you need to include any dll dependencies.)
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.
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.
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.
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.