Issue
When the application fails to find and load an assembly (DLL), following exception is thrown:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Reasons and Solutions
- The assembly itself is not found.In this case, the assembly is not present in your application path. Copy the assembly from release and paste it here and try again.
- The specific version of that assembly is not found.Sometimes, the assembly version referred by the application and the present assembly might vary due to incorrect deployment or during release process.
- Navigate to the application path.
- Open the application config file and template config file.
- Head to the "runtime" section under "configuration".
- You will find the assembly binding redirects. These are used to redirect references of "oldVersion" to "newVersion".Following is the sample assembly redirect:<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>Here, this says, that all references of assemblies from version 0.0.0.0 to 12.0.0.0 (oldVersion) should use 12.0.0.0 (new Version) - So, you should copy the version of Newtonsoft.Json.dll of version 12.0.0.0
- So, if you found an error for this DLL, probably you are using different version DLL.
How to find assembly version?
For TMAC Server, version 5.0.6.3001 onwards assembly versions are printed in logs on start up. Until this version, file versions were printed.
Assembly and file versions are different.
To find assembly version, run this command in your powershell window:
([system.reflection.assembly]::loadfile("C:\Tetherfi\TetherfiHome\TMACServer\Newtonsoft.Json.dll")).FullName
Substitute your application path and assembly name here.
Once you find your assembly version, you can verify what version assembly you have and do the needful.
Report To
If this issue was due to the incorrect release and not due to wrong deployment process, report this to the developer so that release can be corrected.
For TMAC components, report to tmac@tetherfi.com
For WorkQueue components, report to wq@tetherfi.com