Bulk Media Upload Exceptions when running the code
I have a MediaBulkUpload.cs and Program.cs
For Program.cs, I'm encountering this exception upon running the code
System.InvalidOperationException: 'Unable to resolve service for type 'Umbraco.Cms.Core.Scoping.ICoreScopeProvider while attempting to activate Umbraco.Cms.Core.Service.MediaService
var services = new ServiceCollection();
// Register the Umbraco services
services.AddSingleton<IMediaService, MediaService>();
services.AddSingleton<IFileSystem, PhysicalFileSystem>();
// Additional service registrations for Umbraco
// ...
// Build the service provider
var serviceProvider = services.BuildServiceProvider();
// Resolve an instance of MediaService
var mediaService = serviceProvider.GetService<IMediaService>();
// Create an instance of MediaBulkUpload and pass the required dependencies
var bulkUpload = new MediaBulkUpload(mediaService);
// Specify the folder path to perform bulk upload
string folderPath = "TESTFOLDER";
// Call the BulkUploadMedia method
bulkUpload.BulkUploadMedia(folderPath);
// Keep the console window open
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
For context, I'm have a locally hosted Umbraco 11 running on CMD.
Bulk Media Upload Exceptions when running the code
I have a MediaBulkUpload.cs and Program.cs
For Program.cs, I'm encountering this exception upon running the code
System.InvalidOperationException: 'Unable to resolve service for type 'Umbraco.Cms.Core.Scoping.ICoreScopeProvider while attempting to activate Umbraco.Cms.Core.Service.MediaService
For context, I'm have a locally hosted Umbraco 11 running on CMD.
is working on a reply...