I need to centralize a library location for all applications running on the machine, so I am including the following section in machine.config file. As per the comments, the machine.config should only contain settings that differ from their defaults. So I erased everything in machine.config and included this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly" culture="neutral" publicKeyToken="fkjdkfjdfkdjfdkf"/>
<codeBase version="1.2" href="file://C:/libs/myAssembly.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Everything works when I include this section in app.config file. But when I move this to machine.config file, I get the following error in the application -
The type initializer for '...' threw an exception. What could be the problem here? Is this the right way to edit machine.config file.