Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

.NET 2.0 Apps to .NET 4.0+ Framework

Since the release of newer versions of windows,
It's default .NET Framework is v4.0/4.5 (Windows 8 and newer).

Your .NET 2.0 pre-existing apps won't work directly with v4.0/4.5 you must specify the runtime version needed in order for it to work.

In a freshly installed Win10, a .NET 2.0 app will prompt an install of .NET 3.5 framework :

Spoiler (Click to View)

The install is redundant, if your .NET apps doesn't contain obsolete attributes (which probably mostly not) the chances are, it will work on .NET 4+
(See the links below for obsolete attributes)

In order for .NET 2.0 apps to work in .NET 4+ FW, we must export or make an app.exe.config file with the executable we are using.

Example:

My application is called "BytePump.exe"
In order for it to work in .NET v4.0+, I need to make a file called : "BytePump.exe.config".

You can make an app.config file using notepad and pasting this code :

Code
<configuration>
   <startup>
      <supportedRuntime version="v2.0.50727"/>
      <supportedRuntime version="v4.0" />
   </startup>
</configuration>

And then save it as AppName.exe.config (change AppName to your executable's name, in this case, BytePump)

[Image: Capture.PNG]

The app and the .config file must always be in package in order to maximize its compatibility.

You can just ZIP it with the exe, or use RAR as is it better (as it exports all of its content in temp).
And always remember that you must never upload your .exe solely as .exe you must always .zip .rar them whether they are native or .NET.
(spreading is a different thing tho, this focuses on more legal norm.).

For the noobs' sake here's an example :
https://dl.dropboxusercontent.com/s/7np1...xample.rar

VT Scan : https://www.virustotal.com/en/file/06b11.../analysis/
Spoiler (Click to View)

References:
https://msdn.microsoft.com/en-us/library...10%29.aspx
https://msdn.microsoft.com/en-us/library...s.85).aspx
https://msdn.microsoft.com/en-us/library....110).aspx
Useful 🤝

Would using something like ILMerge to combine the files work too?
You can just change the app.config in your solution and it will have the same effect just embedded
(Aug 1, 2015 03:53 AM)Angel Beats‌‌ Wrote:  You can just change the app.config in your solution and it will have the same effect just embedded

This is for pre-existing apps on .NET 2.0 that you have.
(Aug 1, 2015 03:56 AM)YunoLawliet Wrote:  This is for pre-existing apps on .NET 2.0 that you have.

Ahh i see ty for tutorial didnt think of that im tired.
(Aug 1, 2015 03:50 AM)Josh‎ Wrote:  Useful 🤝

Would using something like ILMerge to combine the files work too?

Im not sure of it, I still haven't tweak anything yet, it would be amazing if it can be achieved.
(Aug 1, 2015 03:50 AM)Josh‎ Wrote:  Useful 🤝

Would using something like ILMerge to combine the files work too?

That would destroy the purpose of the config file, as the intention of this feature was to make it easy to support multiple .NET versions without recompiling.
Also, ILmerge only works with .NET assemblies, a config file isn't a .NET assembly.
FR1908
You shouldn't be compiling anything under 4.0 in the first place. Why would you compile an application using obsolete Frameworks? 4.0+ is the way to go.

(Aug 1, 2015 03:53 AM)Angel Beats‌‌ Wrote:  You can just change the app.config in your solution and it will have the same effect just embedded

That's not how you configure pre-built applications.
Is it possible to compile the App with the App.Config?
(Aug 1, 2015 12:57 PM)rezzex Wrote:  Is it possible to compile the App with the App.Config?

Is it possible for you to read the thread?
(Aug 1, 2015 10:59 AM)tweety Wrote:  You shouldn't be compiling anything under 4.0 in the first place. Why would you compile an application using obsolete Frameworks? 4.0+ is the way to go.

Indeed it is. Fuck these shitty crypters and malware.

[Image: 1zL3pDG.jpg]

Yep, but when i use the App.Config in my Solution, i must copy it to my Win 10 Machine too, otherwise it dont get executed.
(Aug 1, 2015 01:01 PM)rezzex Wrote:  Yep, but when i use the App.Config in my Solution, i must copy it to my Win 10 Machine too, otherwise it dont get executed.

No, you still did not read the thread. Try again.
Very useful tutorial here, thank you.
(Aug 1, 2015 01:05 PM)tweety Wrote:  No, you still did not read the thread. Try again.

I know its for already compiled Executables, but i hope it is possible for not compiled Executables to not copy the App.Config everywhere :D

//sry for bad english


Possibly Related Threads...
Thread / Author Replies Views Last Post
by junkyfeet900Aug 6, 2024 10:29 PM 3 391 Aug 6, 2024 10:29 PM
Last Post: junkyfeet900
[.NET] by fisica638Feb 8, 2024 08:07 AM 8 557 Feb 8, 2024 08:07 AM
Last Post: fisica638
[.NET] by QuobiAug 6, 2022 02:23 PM 0 407 Aug 6, 2022 02:23 PM
Last Post: Quobi