I accidentally formatted the disk that contains my .net webforms project. I only have published one. Now I want to get c# codes from published project. Is this possible?
You can't get the exact code, but you can use some softwares that 'decompile' the dll. I call this reverse engineering.
Personally I use ILSPy, heres ILSPy GitHub Repository: https://github.com/icsharpcode/ILSpy
Hope this works for you! Thx
Related
I'm going through some problems with SQLite on Linux and I'd like to inspect Mono.Data.Sqlite source code, but it seems Mono's page on SQLite is outdated and does not point to Mono.Data.Sqlite code repository.
I've done my homework searching it at Google but with no success.
Am I missing something?
It is a class library within the Mono project : https://github.com/mono/mono
https://github.com/mono/mono/tree/master/mcs/class/Mono.Data.Sqlite
we have an application in production and the code is in Pre-Compiled form. The developer who developed that application left the company and we don't have any backup of source code. the only access we have is Pre Compiled code in the server. We need to fix the issues in the application now.
Is there any way to Decompile (extract to actual source code) the PreCompiled code ?
Open the DLLs in the .NET Reflector.
To update #xOn's answer:
Due to a recent source control disaster I had to recover my project from the DLLs. So sadly I'm knowledgable on the procedure:
Get .Net Reflector from here: http://www.red-gate.com/products/dotnet-development/reflector/
You do not seem to need FileDisassembler.
Either load your bins in Reflector or double click them.
Mind that the .Net framework might have not maintained your original project file structure. So if some of your ASPX pages shared the same basic class name in different .cs files (I.E. Inherits tag is the same, but CodeFile tag differs), you would not be able to simply "export source code".
Don't go blindly exporting source files. It won't work.
There will still be some work to be done before being able to just fire up the old build button. For example - DLLs can refer to property's getter/setters directly. You will have to fix that.
Good luck.
Start with:
http://www.red-gate.com/products/dotnet-development/reflector/
...plus:
http://www.denisbauer.com/NETTools/FileDisassembler.aspx
You'll have to recompile the latter to link it against v6.5 of reflector (the latest, as of this post.) It is a good add-on if you want to avoid having to copy and paste ever single class into files by hand. It will dump an entirely assembly as .cs files. I think it may even generate a csproj.
Both tools are free.
I had the similar issue and used Reflector to Decompile it. I got the source code, then changed the bit I wanted, and rebuild it. Then I copied that dll again to Production site. It started to reflect my changes. It was very easy and not at all difficult, maybe because Precompiled site had dlls for every page, and was updatable , so had only code-behind file in dll.
For reference: http://www.reflector.net/
When u install .net reflecter.its import in visual studio.
then you saw the .net reflector tools on menu bar.
Click on .net reflector >>Choose Asseblies (Dll file) to debug.
I found that dll can be just Read using the .NET Reflector tool but can't extract the Source Code. And also once the webforms are precompiled, we can't even get back the code behind files. All we can do is to debug and analyze the Code.
I've been looking at different options for providing auto generated API Documentation and Swagger seems to be up there.
However when trying this out for the first time I'm getting exceptions on start up.
Running Visual Studio 2013.
Create new Web API project.
Using Package Manager, run:
Install-Package Swagger.Net & Install-Packager Swagger.Net.UI
Making sure we've enable the XML documentation we get this exception:
Method 'GetDocumentation' in type 'Swagger.Net.XmlCommentDocumentationProvider'
from assembly 'Swagger.Net, Version=0.5.1.0, Culture=neutral, PublicKeyToken=null'
does not have an implementation.
Does anyone else know of a step we are missing? We found & followed this:
https://github.com/Swagger-Net/Swagger.Net/wiki
https://github.com/Swagger-Net/Swagger.Net/blob/master/README.md
Swagger doesn't support .NET 4.5 - Had to get the source code out from git and modify it to work with 4.5.
Right click the project and set the target framework in there
I have made a library for use with mvc that generates the documentation for you based on attributes. It may be what your looking for.
MVC3: https://www.nuget.org/packages/SwaggerAPIDocumentation/
MVC4: https://www.nuget.org/packages/SwaggerAPIDocumentation.Mvc4/
MVC5: https://www.nuget.org/packages/SwaggerAPIDocumentation.Mvc5/
MVC5.1: https://www.nuget.org/packages/SwaggerAPIDocumentation.Mvc51/
There is dcoumentation in the repository on github just click the project site link. Hope this helps
Try using Swashbuckle.
Based on Swagger as far as I know and it worked first time for me...
https://github.com/domaindrivendev/Swashbuckle
I am implementing OpenID+OAuth in my ASP.NET WebForm (using .NET Framework 3.5) application, found example on net
https://groups.google.com/forum/?fromgroups=#!topic/dotnetopenid/xQYkE6sUZYU
But I am missing DotNetOpenAuth.ApplicationBlock namespace, I included these libraries in my project:
DotNetOpenAuth.dll
DotNetOpenAuth.OAuth2.dll
DotNetOpenAuth.OAuth2.Client.dll
Can any one suggest me where I am doing wrong?
The ApplicationBlock is not distributed in binary form as it is intended for copy+paste of relevant source code into your project. You can get the ApplicationBlock project from the samples distribution on SourceForge.
You can find the project under the DotNotOpenAuth folders at Samples/DotNetOpenAuth.ApplicationBlock
I had a problem I lost all my source(CS) of web site pages but I had only published pages on server ,so please if there is any way to recover theses published pages to orignal pages with code,bin folder
You need to decompile the C#. It is an advanced user scenario, but it can be done... sort of.
How do I decompile a .NET EXE into readable C# source code?
try to use reflector. it help you to restore all your code
Use your latest backup copy, or roll back to the previous version of SVN you are working on.
http://www.red-gate.com/products/dotnet-development/reflector/ is a good piece of software for recovering source from a compiled program.
If your project was a website, you should be able to ftp each file from the server 1 for 1. If your file was a web application project, you're hosed. The code files are compiled into a binary, and if you lost the source code it's gone.
http://www.red-gate.com/products/dotnet-development/reflector/ Can decompile .NET assemblies into source code - however it won't be the code you wrote as alot of it will have been changed by the compiler (IE your comments will have gone bye bye)
You can then rebuild your Project in your IDE of choice and you are done.
If the assemblies haven't been obfuscated, you can use reflector to recover your code from the assemblies.