The problem happened when client asked about obfuscated version of my framework. Nothing really changed in my code except my framework was obfuscated with ConfuserEX (see details below). Since then every time when client tried to access DB data he got following exception:
Code: Select all
Exception occured in mscorlib in Byte* GetResource(System.Reflection.RuntimeAssembly, System.String, UInt64 ByRef, System.Runtime.CompilerServices.StackCrawlMarkHandle, Boolean): Could not load file or assembly 'vLphEwYBDrCYdfNUCEXEFAdcMiEE, Version=0.0.0.0, Culture=neutral, PublicKeyToken=43b2a5dae6e35ee1' or one of its dependencies. The system cannot find the file specified. (stack trace:
at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name)
at Devart.Common.CRLicenseProvider.a(LicenseContext A_0, Type A_1, String& A_2, String& A_3, String& A_4)
at Devart.Common.CRLicenseProvider.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4, String& A_5)
at Devart.Common.CRLicenseProvider.a(LicenseContext A_0, Type A_1, Boolean A_2)
at Devart.Data.Oracle.OracleProviderFactory.CreateConnection()
at System.Data.EntityClient.EntityConnection.GetStoreConnection(DbProviderFactory factory)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
at Base.DomainModel.RTDB.RTDBEntities..ctor(String connectionString) in X:\Implementation\MSC\source\Base.DomainModel.RTDB\RTDBModel.Designer.cs:line 75
at Base.DbAccess.EntitiesFactory.GetRtdbEntities(Boolean lazyLoadingEnabled) in X:\Implementation\MSC\source\Base.DbAccess\EntitiesFactory.cs:line 59
at TPM.PCFCLOG.ContentHandlers.OnQuickStopFinalLoggingHandler.HandleEvent(Event eventContent) in X:\Implementation\MSC\source\TPM.PCFCLOG\ContentHandlers\OnQuickStopFinalLoggingHandler.cs:line 41)
Finally I figured out that when I turn off one of Confuser protection rules (resources) problem disappears (see below).
Code: Select all
<!-- part of ConfuserEx configuration file -->
<rule pattern="true" inherit="false">
<protection id="anti ildasm" />
<protection id="anti tamper" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<!-- commented due to issue with Devart library -->
<!-- <protection id="resources" /> -->
</rule>
The dotconnect for Oracle version used was 9.x (many projects, using many different versions of your library, all ending with the same issue).