Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which machine.config file is my solution using on the server?

I have an asp.net application that requires some editing of the machine.config file in order to work properly. On my development machine(running windows xp), I edited the machine.config file at the location: "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"

This is the line of code I modified, with modifications(adding user/pass):

<processModel autoConfig="true" userName="SYSTEM" password="AutoGenerate">

On the server(running windows server 2003) I made the same changes to the same file at the same location. However, when I debug the solution, it does not work properly(nothing happens and it times out, the same issue I had on my development machine before making these changes to the config file).

I have come down to the fact that my application is not using the machine.config file at the same location on both my machine and the server. To confirm this, I added random numbers to the end of userName and password in both config files. On my machine, the application does not even run after I do this. On the server, it runs and errs out the same way before the random numbers were added.

My question, in short, is how do I figure out what machine.config file the server is actually using and/or how can I set it to use the one at the location mentioned?

like image 654
turbo Avatar asked Feb 10 '12 19:02

turbo


1 Answers

It's possible that your server is a 64-bit server, which means it will be in:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727

The 64-bit runtime uses a different machine.config. The basic rules are this:

  1. ASP.NET 1.x uses %WINDIR%\Microsoft.NET\Framework\v1.1.4322
  2. ASP.NET 2.0 / 3.5 x86 uses %WINDIR%\Microsoft.NET\Framework\v2.0.50727
  3. ASP.NET 2.0 / 3.5 x64 uses %WINDIR%\Microsoft.NET\Framework64\v2.0.50727
  4. ASP.NET 4.0 / 4.5.x x86 uses %WINDIR%\Microsoft.NET\Framework\v4.0.30319
  5. ASP.NET 4.0 / 4.5.x x64 uses %WINDIR%\Microsoft.NET\Framework64\v4.0.30319
  6. For ASP.NET 5.0 using the Full CLR, this will be the same as the ASP.NET 4.0 locations since the .NET Framework 4.6 is a drop in replacement for 4.5. If ASP.NET 5.0 is running on the CoreCLR, there is no concept of a machine.config file.

Which version of ASP.NET you use depends on your ASP.NET Tab (IIS 6) or AppPool (IIS 7+)

x64 vs. x86 depends on the metadata setting W3SVC/AppPools/Enable32BitAppOnWin64 for IIS 6, or the AppPool in IIS 7.

like image 69
vcsjones Avatar answered Oct 20 '22 01:10

vcsjones