Hi Team,
I am getting below error while running .net core project on Service Fabric Cluster.
System.BadImageFormatException: 'Could not load file or assembly 'System.ComponentModel, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Format of the executable (.exe) or library (.dll) is invalid.'
Please do the neeful.
geetha geethaPosted Dec 6, 2021, 9:02 AM
Lakshna SPosted Dec 4, 2021, 2:03 PM
In many cases, this can be solved by adding the following code to the csproj file of your test project:
This forces the build process to create a.dll.configfile in the output directory with the needed binding redirects.tarun sPosted Dec 3, 2021, 11:11 AM
Installed nuget package System.ComponentModel and no luck.
(serviceContext)) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup() .UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.None) .UseUrls(url) .Build(); }))
I tried to change the project to 64 bit and ran the solution but no luck. After that re installed all the softwares like vs and sdks. But still getting the same error at this place on Service layer
new ServiceInstanceListener(serviceContext => new KestrelCommunicationListener(serviceContext, "ServiceEndpoint", (url, listener) => { ServiceEventSource.Current.ServiceMessage(serviceContext, $"Starting Kestrel on {url}"); return new WebHostBuilder() .UseKestrel() .UseCommonConfiguration() .ConfigureServices( services => services .AddSingleton
Avnish KumarPosted Dec 3, 2021, 10:47 AM