Closed brandonros closed 3 months ago
Copied a bunch of DLLs from C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\8.0.0\
to C:\Program Files (x86)\BMW\ISTA\TesterGUI\bin\Release
2024-05-24 12:02:21.782 ERROR [T] ISTA: [1] App.Init() - Failed to start ISTA: System.TypeLoadException: Could not load type 'System.Object' from assembly 'System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because the parent does not exist.
at BMW.ISPI.IstaServices.Client.IstaIcsServiceClient.ValidateHost()
at BMW.ISPI.IstaServices.Client.IstaIcsServiceClient.GetMarketLanguage()
at BMW.Rheingold.RheingoldSessionController.Logic.ResetLang()
at BMW.Rheingold.RheingoldSessionController.Logic.InitProgrammingSessionData()
at BMW.Rheingold.RheingoldSessionController.Logic..ctor(IDatabaseProvider database, IFasta2Service fasta2)
at BMW.Rheingold.ISTAGUI.Controller.MultisessionLogic..ctor(Dispatcher dispatcher, String istaOperationProcessDir, INavigationServiceGui navigationService, IDatabaseProvider database, IPrintWatchDog printWatchDog, Dictionary`2 configuration)
at BMW.Rheingold.ISTAGUI.App.InitMultiSessionLogic()
at BMW.Rheingold.ISTAGUI.App.Init()
at BMW.Rheingold.ISTAGUI.App..ctor()
Are we like mixing and matching netframework48, net8.0, netcoreapp8.0 DLLs? We're introducing System.Diagnostics.Process (and others) dependency/references with the patches but not providing the DLL (or its dependencies) to the directory its loading assemblies from.
ISTAGUI is a .NETFramework v4.8 app
From ILSpy:
// Detected TargetFramework-Id: .NETFramework,Version=v4.8
// Detected RuntimePack: Microsoft.NETCore.App
// Referenced assemblies (in metadata order):
// IstaServicesContract, Version=4.47.18.27933, Culture=neutral, PublicKeyToken=6505efbdc3e5f324
// Assembly reference loading information:
// Info: Success - Found in Assembly List
// mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly reference loading information:
// Info: Success - Found in Assembly List
// RheingoldProcessCommunicationBase, Version=4.47.18.27933, Culture=neutral, PublicKeyToken=6505efbdc3e5f324
// Assembly reference loading information:
// Info: Success - Found in Assembly List
// System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly reference loading information:
// Info: Success - Found in Assembly List
// System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly reference loading information:
// Info: Success - Found in Assembly List
// System.Diagnostics.Process, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// Assembly reference loading information:
// There were some problems during assembly reference load, see below for more information!
// Error: Could not find reference: System.Diagnostics.Process, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
// Assembly reference loading information:
// Info: Success - Found in Assembly List with different TFM or version: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.5\System.Private.CoreLib.dll
// System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly reference loading information:
// Info: Success - Found in Assembly List
// Assembly load log including transitive references:
// IstaServicesContract, Version=4.47.18.27933, Culture=neutral, PublicKeyToken=6505efbdc3e5f324
// Info: Success - Found in Assembly List
// mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Info: Success - Found in Assembly List
// System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Info: Success - Found in Assembly List
// RheingoldProcessCommunicationBase, Version=4.47.18.27933, Culture=neutral, PublicKeyToken=6505efbdc3e5f324
// Info: Success - Found in Assembly List
// System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Info: Success - Found in Assembly List
// System.Diagnostics.Process, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// Error: Could not find reference: System.Diagnostics.Process, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Info: Success - Found in Assembly List
// System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
// Info: Success - Found in Assembly List with different TFM or version: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.5\System.Private.CoreLib.dll
// System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// Info: Success - Found in Assembly List
// System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Info: Success - Found in Assembly List
Got around it with this:
using System;
using dnlib.DotNet;
class Program
{
static void Main(string[] args)
{
string assemblyPath = @"IstaServicesClient.dll";
ModuleDefMD module = ModuleDefMD.Load(assemblyPath);
AssemblyRef ref1 = null;
foreach (var assemblyRef in module.GetAssemblyRefs())
{
if (assemblyRef.Name == "System.Diagnostics.Process")
{
assemblyRef.Version = new Version(4, 0, 0, 0);
Console.WriteLine("Reference version changed to 4.0.0.0");
}
if (assemblyRef.Name == "mscorlib")
{
ref1 = assemblyRef;
}
}
foreach (var assemblyRef in module.GetAssemblyRefs())
{
if (assemblyRef.Name == "System.Private.CoreLib")
{
assemblyRef.Name = ref1.Name;
assemblyRef.Version = ref1.Version;
assemblyRef.PublicKeyOrToken = ref1.PublicKeyOrToken;
}
}
// Save the modified assembly
string outputPath = @"IstaServicesClient-patched.dll";
module.Write(outputPath);
Console.WriteLine("Assembly saved to " + outputPath);
}
}
New error:
2024-05-24 13:44:07.620 ERROR [T] Thread-ID: [9] Caller-PID: [5328] IstaServiceOperationInvoker.Invoke - failed with exception: BMW.iLean.CommonServices.Exceptions.CommonServiceException: 0A_ICS0133: CommonserviceException, see inner exception for more details ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at BMW.iLean.CommonServices.Helper.ObjectToStringHelper.ObjectToByteArray(Object dataToSerialize)
at BMW.iLean.CommonServices.Helper.ObjectToStringHelper.ObjectToString(Object dataToSerialize)
at BMW.iLean.CommonServices.Models.LocationBasedParameterList.GetLocationBasedParameter(String countryCode, String environment, String nameSpace, String name)
at BMW.iLean.CommonServices.Services.BDRCommonServices.GetLocationBasedParameterValue(String nameSpace, String parameterName, InterfaceVersion interfaceVersion)
at BMW.iLean.CommonServices.Services.BDRCommonServices.GetLocationBasedParameterValue(String nameSpace, String parameterName)
--- End of inner exception stack trace ---
at BMW.iLean.CommonServices.Services.BDRCommonServices.GetLocationBasedParameterValue(String nameSpace, String parameterName)
at BMW.Rheingold.RheingoldISPINext.ICS.CommonServiceWrapper.GetSecureFeatureActivationUrl()
at BMW.Rheingold.RheingoldISPINext.ICS.CommonServiceWrapper.GetLocationBasedParameters()
at BMW.ISPI.IstaServices.Impl.ICS.IstaIcsServiceImpl.GetLocationBasedParameters()
at SyncInvokeGetLocationBasedParameters(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at BMW.ISPI.IstaServices.Impl.IstaServiceOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
Previously I'd use the BuildCall
to build a new function which would introduce 8.0 assemblies and is undesirable, current implementation is to find and reuse the function reference in the ISTA program itself.
So why this happened again need some test and inspection, by the way which version of ista-patcher you had used.
I seem to be running into the same problem myself. Is there a workaround or a fix for this issue? I'm using the latest ISTA Patcher with ISTA 4.48.1x on Windows 11 Professional.
I seem to be running into the same problem myself. Is there a workaround or a fix for this issue? I'm using the latest ISTA Patcher with ISTA 4.48.1x on Windows 11 Professional.
Which version did you use, version from the release page? if yes, try the version from the latest CI from here first.
Yes, I tried using the version 2.1.1 from the releases. I'll try the CI version now and report back.
The CI build appears to have fixed the issue. I'm able to open ISTA, haven't tried a car yet (scanning or programming) but I'll try that shortly and see what the results are.
I was able to run diagnostics and calculate a measure plan for programming (didn't get a chance to execute the measures plan). Seems to have fixed the issue.