Deployment without installing to Windows server

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
meysam57
Posts: 0
Joined: Mon 10 Aug 2015 05:05

Deployment without installing to Windows server

Post by meysam57 » Wed 13 Nov 2019 10:34

First of all, If we have to install dotConnect to the windows server we will, but the goal is to be able to do our deployments without having to worry about installing dotConnect package to the windows server.
  • I have the 3 DLLs(Devart.Data,Devart.Data.Oracle,Devart.Data.Oracle.Entity.EF6)
  • Set the 3 DLLs to "Copy Local" (so that they copy to the BIN directory output on build)
  • Success Generate a License file using the License Generation Wizard
  • web config:
    <compilation debug="true" targetFramework="4.5">
    <assemblies>
    <add assembly="Devart.Data, Version=5.0.2158.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701"/>
    <add assembly="Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701"/>
    </assemblies>
    </compilation>

    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity.EF6, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701" />
    </providers>
    </entityFramework>

    <system.data>
    <DbProviderFactories>
    <remove invariant="Devart.Data.Oracle" />
    <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Culture=neutral, PublicKeyToken=09AF7300EEC23701" />
    </DbProviderFactories>
    </system.data>

but an error when executing my website
Could not load file or assembly 'Devart.Data.Oracle' or one of its dependencies. Strong name signature could not be verified.


Any help?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Deployment without installing to Windows server

Post by Shalex » Thu 14 Nov 2019 18:46

Please add the version to the DbProviderFactories registration:

Code: Select all

<system.data>
  <DbProviderFactories>
    <remove invariant="Devart.Data.Oracle" />
    <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  </DbProviderFactories>
</system.data>
Refer to https://www.devart.com/dotconnect/oracl ... yment.html.

meysam57
Posts: 0
Joined: Mon 10 Aug 2015 05:05

Re: Deployment without installing to Windows server

Post by meysam57 » Sat 16 Nov 2019 09:10

Shalex wrote: Thu 14 Nov 2019 18:46 Please add the version to the DbProviderFactories registration:

Code: Select all

<system.data>
  <DbProviderFactories>
    <remove invariant="Devart.Data.Oracle" />
    <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  </DbProviderFactories>
</system.data>
Refer to https://www.devart.com/dotconnect/oracl ... yment.html.

Did not work.
Please help,this has been driving me crazy for the last 5 days.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Deployment without installing to Windows server

Post by Shalex » Sat 16 Nov 2019 15:05

1. Try using original lower case in all Devart entries of your web.config:
PublicKeyToken=09AF7300EEC23701
->
PublicKeyToken=09af7300eec23701

2. Confirm that .NET Framework 4.5 is installed on your deployment server.

3. Specify the full stack trace of the exception.

meysam57
Posts: 0
Joined: Mon 10 Aug 2015 05:05

Re: Deployment without installing to Windows server

Post by meysam57 » Wed 27 Nov 2019 05:36

Shalex wrote: Sat 16 Nov 2019 15:05 1. Try using original lower case in all Devart entries of your web.config:
PublicKeyToken=09AF7300EEC23701
->
PublicKeyToken=09af7300eec23701

2. Confirm that .NET Framework 4.5 is installed on your deployment server.

3. Specify the full stack trace of the exception.
  • .NET Framework 4.5 already installed.
  • All public key token in lower case.
webconfig:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>

  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity.EF6, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.Oracle" />
      <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
  
  <system.web>
    <compilation targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
  </system.web>
  
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.4.0" newVersion="5.2.4.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  
  <connectionStrings>
    <add name="StoreEntities" connectionString="metadata=res://*/Models.StoreModel.csdl|res://*/Models.StoreModel.ssdl|res://*/Models.StoreModel.msl;provider=Devart.Data.Oracle;provider connection string=&quot;User Id=;Password=;Server=172.20.128.33;Direct=True;Sid=orcl;Persist Security Info=True&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
  
</configuration>
<!--ProjectGuid: 6D38E34C-E3D8-4C40-BF44-586799FEE4B6-->
exception:

Code: Select all

Server Error in '/Publish' Application.
Could not load file or assembly 'Devart.Data.Oracle' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Devart.Data.Oracle' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Devart.Data.Oracle' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Stack Trace:


[FileLoadException: Could not load file or assembly 'Devart.Data.Oracle' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]

[FileLoadException: Could not load file or assembly 'Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): Could not load file or assembly 'Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261


Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Deployment without installing to Windows server

Post by Shalex » Thu 28 Nov 2019 16:58

1. Your website works OK in the development environment with the installed provider, but fails on the deployment server without installed provider. Is this correct?

2. With sn.exe shipped with .NET Framework SDK on the deployment server, make sure that it verifies Devart.Data.dll, Devart.Data.Oracle.dll, Devart.Data.Oracle.EF6.dll successfully.

3. Try adding the following entries to web.config:

Code: Select all

<system.web>  
  <compilation  targetFramework="4.5">  
    <assemblies>
      <add assembly="Devart.Data, Version=5.0.2158.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
      <add assembly="Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
      <add assembly="Devart.Data.Oracle.Entity.EF6, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
    </assemblies>  
  </compilation>   
</system.web>
4. Clear the folders in the deployment:
* C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
• C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\
• C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
• C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\
• C:\Users\YOUR_OS_USER\AppData\Local\Temp\Temporary ASP.NET Files\
Does this help?

5. Send us a small test project so that we can reproduce the issue in our test environment.

meysam57
Posts: 0
Joined: Mon 10 Aug 2015 05:05

Re: Deployment without installing to Windows server

Post by meysam57 » Sat 30 Nov 2019 07:01

PLease check your mail box.

meysam57
Posts: 0
Joined: Mon 10 Aug 2015 05:05

Re: Deployment without installing to Windows server

Post by meysam57 » Sat 30 Nov 2019 09:09

Shalex wrote: Thu 28 Nov 2019 16:58 1. Your website works OK in the development environment with the installed provider, but fails on the deployment server without installed provider. Is this correct?

2. With sn.exe shipped with .NET Framework SDK on the deployment server, make sure that it verifies Devart.Data.dll, Devart.Data.Oracle.dll, Devart.Data.Oracle.EF6.dll successfully.

3. Try adding the following entries to web.config:

Code: Select all

<system.web>  
  <compilation  targetFramework="4.5">  
    <assemblies>
      <add assembly="Devart.Data, Version=5.0.2158.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
      <add assembly="Devart.Data.Oracle, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
      <add assembly="Devart.Data.Oracle.Entity.EF6, Version=9.7.734.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
    </assemblies>  
  </compilation>   
</system.web>
4. Clear the folders in the deployment:
* C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
• C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\
• C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
• C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\
• C:\Users\YOUR_OS_USER\AppData\Local\Temp\Temporary ASP.NET Files\
Does this help?

5. Send us a small test project so that we can reproduce the issue in our test environment.

Thank you,The latest update solved my problem.

Post Reply