hello
I am from M1 and I am using the package IBM. EntityFrameworkCore osx. Currently, I have similar errors as him:
System.IO.FileNotFoundException: Could not load file or assembly 'IBM.EntityFrameworkCore, Version=8.0.0.200, Culture=neutral, PublicKeyToken=7c307b91aa13d208'. The system cannot find the file specified.
File name: 'IBM.EntityFrameworkCore, Version=8.0.0.200, Culture=neutral, PublicKeyToken=7c307b91aa13d208'
at Program.<>c__DisplayClass0_0.<<Main>$>b__0(DbContextOptionsBuilder options)
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass1_0`2.<AddDbContext>b__0(IServiceProvider _, DbContextOptionsBuilder b)
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CreateDbContextOptions[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass17_0`1.<AddCoreServices>b__0(IServiceProvider p)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at lambda_method2(Closure, IServiceProvider, Object[])
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Looking forward to your reply, thank you
------------------------------
qin zhaofan
------------------------------
Original Message:
Sent: Mon April 15, 2024 09:19 AM
From: Hosathota Vishwanatha
Subject: Net.IBM.Data.Db2-osx not working
Hi Tariq,
at present we have support for M1/M2 and are yet to validate for M3. We suspect some structural changes in M3 which is affecting this. Can you please approach IBM tech support and open a case so that we can meet you and troubleshoot?
Thanks
Vishwa
------------------------------
Hosathota Vishwanatha
Original Message:
Sent: Fri April 05, 2024 09:34 AM
From: Tariq M
Subject: Net.IBM.Data.Db2-osx not working
Hello,
I have a dotnet core project using Net.IBM.Data.Db2 and it works with both Windows and Linux. I am now trying to get it to run on a Apple Macbook M3 Pro, however, it fails at run time with the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'IBM.Data.Db2, Version=8.0.0.200, Culture=neutral, PublicKeyToken=7c307b91aa13d208'. The system cannot find the file specified.
My console app contains the following code.
ConsoleApp1.csproj:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="Dapper" Version="2.1.37" /> <!-- <PackageReference Include="Net.IBM.Data.Db2" Version="8.0.0.200" Condition="$([MSBuild]::IsOsPlatform('Windows'))" /> --> <!-- <PackageReference Include="Net.IBM.Data.Db2-lnx" Version="8.0.0.200" Condition="$([MSBuild]::IsOsPlatform('Linux'))" /> --> <!-- <PackageReference Include="Net.IBM.Data.Db2-osx" Version="8.0.0.200" Condition="$([MSBuild]::IsOsPlatform('OSX'))" /> --> <PackageReference Include="Net.IBM.Data.Db2-osx" Version="8.0.0.200" /></ItemGroup></Project>
Program.cs:
The above throws the following run time error:
Exception has occurred: CLR/System.IO.FileNotFoundExceptionAn unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Private.CoreLib.dll: 'Could not load file or assembly 'IBM.Data.Db2, Version=8.0.0.200, Culture=neutral, PublicKeyToken=7c307b91aa13d208'. The system cannot find the file specified.' at Program.<<Main>$>d__0.MoveNext() in /Users/me/dev/ConsoleApp1/ConsoleApp1/Program.cs:line 17 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Program.<Main>$(String[] args) in /Users/me/dev/ConsoleApp1/ConsoleApp1/Program.cs:line 6 at Program.<Main>(String[] args)
The same project works perfectly fine on Windows and Linux so I'm at a loss as to what could be wrong.
------------------------------
Tariq M
------------------------------