Opc.Ua.Configuration.ConfigUtils.VerifyCodebase C# (CSharp) Method

VerifyCodebase() private static method

Checks that the assembly loaded has the expected codebase.
private static VerifyCodebase ( Assembly assembly, string filepath ) : void
assembly System.Reflection.Assembly
filepath string
return void
		private static void VerifyCodebase(Assembly assembly, string filepath)
		{
			string codebase = assembly.CodeBase.ToLower();
			string normalizedPath = filepath.Replace('\\', '/').Replace("//", "/").ToLower();

			if (!normalizedPath.StartsWith("file:///"))
			{
				normalizedPath = "file:///" + normalizedPath;
			}

			if (codebase != normalizedPath)
			{
				throw new ApplicationException(String.Format("Duplicate assembly loaded. You need to restart the configuration tool.\r\n{0}\r\n{1}", codebase, normalizedPath));
			}
		}