Skip to main content
Solved

Multiple Environments Deploy error

  • 17 May 2024
  • 4 replies
  • 87 views

When deploying the project in the PROD environment (through multiple environment transfer) we get the following error.:

 


Source: System.Memory Type: System.IO.FileLoadException Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at System.MemoryExtensions.AsSpan(String text) at Microsoft.Data.LocalDBAPI.GetLocalDbInstanceNameFromServerName(String serverName) at Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) at Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) at Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString, SqlCredential credential) at TimeXtender.Sql.Engine.SqlEngine2022.GetServerConnection(String connnectionString) at TimeXtender.Sql.Engine.SqlEngineBase.CreateServerConnection(SqlServer sqlServer) at TimeXtender.Sql.Engine.SqlEngineBase.InitializeFromSqlServer(SqlServer sqlServer) at TimeXtender.DataManager.DataSource_Sql.GetSqlEngine(Boolean startTransaction, Boolean singleConnection) at TimeXtender.DataManager.StepTableSimpleDeploy.DoAbstractStep(StepSetup stepSetup)

4 replies

Userlevel 6
Badge +5

Hi @Erwins 

Check the installation folder. There is a config file in there called timextender.exe.config.

It contains what version of system.memory is expected.

What does your file show and what version of TimeXtender are you currently on?

Hi Thomas,

 

below the config file contents.

We’re using JDM 20.10.45.64.

I've also made a YT video:

timeXtender.exe config file:

<?xml version ="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <runtime>
    <loadFromRemoteSources enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DocModel" publicKeyToken="47E3ED7023A3D0AE" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.3.15064" newVersion="3.0.3.15064" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.AnalysisServices.AdomdClient" publicKeyToken="89845DCD8080CC91" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.1-4.1.1.2" newVersion="4.1.1.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

 

TXServer.exe config file:

 

<?xml version ="1.0"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0"/>
    </startup>
    <runtime>
        <loadFromRemoteSources enabled="true" />
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.1-4.1.1.2" newVersion="4.1.1.2" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

 

Userlevel 6
Badge +5

It would seem like the 'System.Runtime.CompilerServices.Unsafe is outside the range if you are running version 4.0.4.1

Thankfully we have fixed this in the newest release. In my version 20.10.49 the TXServer.exe.config looks like this.

<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
<runtime>
<loadFromRemoteSources enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="4.0.0.1-4.1.1.2" newVersion="4.1.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

I could not find a release note for the change, alternatively you can overwrite your existing file with the above.

 

@Thomas Lind awesome, this worked!

You're the best!

Reply