Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where Is Machine.Config?

I want to apply a change so That I can use Server GC settings for my C# 3.5 app - I can do that by editing the machine.config file.

The only problem is I do not know where that is.

How can I find the path of this file in a repeatable way across a number of different machines

like image 539
Jack Kada Avatar asked Feb 24 '10 11:02

Jack Kada


People also ask

What is machine config file?

Machine configuration file, Machine. config, contains settings that apply to an entire computer. It is specifically used to store machine and application settings global to all asp.net web sites running in IIS in a computer. A system can have only one machine.

Where is the machine level web config?

The machine. config file will automatically installed when you install Visual Studio.Net and it exist exists in the c:\windows\microsoft.net\framework\version\config folder whereas web. config will automatically created when you create an ASP.Net web application project.

How do I find my config file?

Configuration files are normally saved in the Settings folder inside the My Documents\Source Insight folder.

Where is Aspnet config file?

config file is located in the %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\ directory.


2 Answers

32-bit

%windir%\Microsoft.NET\Framework\[version]\config\machine.config 

64-bit

%windir%\Microsoft.NET\Framework64\[version]\config\machine.config  

[version] should be equal to v1.0.3705, v1.1.4322, v2.0.50727 or v4.0.30319.

v3.0 and v3.5 just contain additional assemblies to v2.0.50727 so there should be no config\machine.config. v4.5.x and v4.6.x are stored inside v4.0.30319.

like image 184
Peter Avatar answered Oct 11 '22 14:10

Peter


You can run this in powershell:

[System.Runtime.InteropServices.RuntimeEnvironment]::SystemConfigurationFile 

Which outputs this for .net 4:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 

Note however that this might change depending on whether .net is running as 32 or 64 bit which will result in \Framework\ or \Framework64\ respectively.

like image 39
Daniel Little Avatar answered Oct 11 '22 13:10

Daniel Little