Click here to Skip to main content
16,022,060 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is the bottom line and I will cut to the proverbial chase. I have created an executable in release mode from Microsoft Visual Studio that is a console application. When I put this .EXE file in a newly-created and empty folder on my computer, it runs without throwing any errors. It seems to work as it is supposed to.

I have given the program to my IT guy who took it from a flash drive to another computer and ran it from the command line (aka "dos prompt") and it says:

Quote:
The application to execute does not exist: 'c:\SharePointListCreation.dll'


The strange thing is that the executable is called 'SharePointListCreation.EXE'. So the error message contains name of the executable but instead of .EXE, it has .DLL. And, why would it call a DLL an application?

I have written a Console App program in Microsoft Visual Studio and compiled using the "Batch Build" command. I have placed this executable into its own folder as I am told from a tutorial to do so that it can run as a task from the Windows 10 "Task Scheduler". It works. I mean, it seems to run from my computer.

My IT guy wants it to be run off the server at the company. So he showed me how to download the settings from the "Task Scheduler". This file is an .XML file.

I have shared the folder that has the .EXE and .XML files with him and he has recently come back to tell me that when he tried to run this program from the command line (it is a console app, by the way), he got an error message stating that there were .DLL's missing.

What associated DLL's need to be included for the release of this net6.0 console app? I went into the directory where Microsoft Visual built the release version of the executable and I see a lot of .DLL's. Which ones should be used by being moved to the folder. Is there another way I could do this? Please advise.

Here is the list of files in the Release folder (what a huge list! Surely, they can not all be required !):

Terminal
 Volume in drive C is OS
 Volume Serial Number is C292-BE2E

 Directory of C:\source\repos\SharePointListCreation\bin\Release\net6.0

09/26/2024  09:29 AM    <dir>          .
09/26/2024  09:29 AM    <dir>          ..
01/15/2023  05:45 PM           406,528 AngleSharp.Css.dll
05/31/2022  01:44 PM           882,176 AngleSharp.dll
07/26/2021  06:36 PM           378,744 Microsoft.ApplicationInsights.dll
11/12/2018  12:30 PM            22,904 Microsoft.AspNetCore.Hosting.Abstractions.dll
11/12/2018  12:30 PM            15,224 Microsoft.AspNetCore.Hosting.Server.Abstractions.dll
11/12/2018  12:29 PM            76,152 Microsoft.AspNetCore.Http.Abstractions.dll
11/12/2018  12:29 PM            38,776 Microsoft.AspNetCore.Http.Extensions.dll
11/12/2018  12:28 PM            32,120 Microsoft.AspNetCore.Http.Features.dll
11/12/2018  12:37 PM            70,520 Microsoft.AspNetCore.StaticFiles.dll
10/22/2021  06:47 PM            27,264 Microsoft.Extensions.Caching.Abstractions.dll
01/14/2022  02:54 PM            38,504 Microsoft.Extensions.Caching.Memory.dll
10/22/2021  06:47 PM            25,216 Microsoft.Extensions.Configuration.Abstractions.dll
10/22/2021  06:48 PM            43,632 Microsoft.Extensions.DependencyInjection.Abstractions.dll
09/26/2022  12:42 PM            82,560 Microsoft.Extensions.DependencyInjection.dll
11/10/2018  07:26 PM            17,976 Microsoft.Extensions.FileProviders.Abstractions.dll
11/12/2018  12:30 PM            22,904 Microsoft.Extensions.Hosting.Abstractions.dll
10/22/2021  06:50 PM            68,736 Microsoft.Extensions.Http.dll
10/22/2021  06:51 PM            62,064 Microsoft.Extensions.Logging.Abstractions.dll
10/22/2021  06:50 PM            44,656 Microsoft.Extensions.Logging.dll
10/22/2021  06:50 PM            59,008 Microsoft.Extensions.Options.dll
10/22/2021  06:51 PM            40,048 Microsoft.Extensions.Primitives.dll
11/12/2018  12:28 PM            19,832 Microsoft.Extensions.WebEncoders.dll
03/25/2021  06:18 PM           142,224 Microsoft.Graph.Core.dll
05/20/2021  05:05 PM         8,584,592 Microsoft.Graph.dll
06/06/2024  05:09 PM         1,005,600 Microsoft.Identity.Client.dll
06/06/2024  05:14 PM            66,592 Microsoft.Identity.Client.Extensions.Msal.dll
08/21/2024  11:16 PM            20,000 Microsoft.IdentityModel.Abstractions.dll
08/21/2024  11:16 PM           155,160 Microsoft.IdentityModel.JsonWebTokens.dll
08/21/2024  11:16 PM            36,896 Microsoft.IdentityModel.Logging.dll
08/21/2024  11:16 PM           337,432 Microsoft.IdentityModel.Tokens.dll
11/12/2018  12:28 PM            74,616 Microsoft.Net.Http.Headers.dll
08/20/2024  02:34 PM           101,056 Microsoft.Office.Client.Policy.dll
08/20/2024  02:34 PM            41,720 Microsoft.Office.Client.TranslationServices.dll
08/20/2024  02:34 PM           108,120 Microsoft.Office.SharePoint.Tools.dll
08/20/2024  02:34 PM           528,520 Microsoft.Online.SharePoint.Client.Tenant.dll
08/20/2024  02:34 PM           416,536 Microsoft.ProjectServer.Client.dll
08/20/2024  02:34 PM         1,493,144 Microsoft.SharePoint.Client.dll
08/20/2024  02:34 PM            50,920 Microsoft.SharePoint.Client.DocumentManagement.dll
08/20/2024  02:34 PM           168,680 Microsoft.SharePoint.Client.Publishing.dll
08/20/2024  02:34 PM           200,888 Microsoft.SharePoint.Client.Runtime.dll
08/20/2024  02:34 PM            30,408 Microsoft.SharePoint.Client.Search.Applications.dll
08/20/2024  02:34 PM           138,816 Microsoft.SharePoint.Client.Search.dll
08/20/2024  02:34 PM            92,432 Microsoft.SharePoint.Client.Taxonomy.dll
08/20/2024  02:34 PM           181,968 Microsoft.SharePoint.Client.UserProfiles.dll
08/20/2024  02:34 PM            54,416 Microsoft.SharePoint.Client.WorkflowServices.dll
10/22/2021  06:40 PM            26,224 Microsoft.Win32.SystemEvents.dll
03/17/2021  03:03 PM           695,336 Newtonsoft.Json.dll
09/26/2024  09:29 AM                 0 output.txt
08/16/2024  06:24 AM         2,518,448 PnP.Core.dll
08/16/2024  06:41 AM        11,162,672 PnP.Framework.dll
10/29/2020  06:07 AM           259,072 Portable.Xaml.dll
09/24/2024  11:26 AM    <dir>          runtimes
09/25/2024  08:14 PM            96,506 SharePointListCreation.deps.json
09/25/2024  08:14 PM            81,920 SharePointListCreation.dll
09/25/2024  08:14 PM           151,040 SharePointListCreation.exe
09/25/2024  08:14 PM            35,328 SharePointListCreation.pdb
09/25/2024  08:14 PM               253 SharePointListCreation.runtimeconfig.json
08/19/2022  02:58 PM           396,424 System.Configuration.ConfigurationManager.dll
02/15/2023  07:32 PM           145,072 System.Diagnostics.DiagnosticSource.dll
10/22/2021  06:51 PM           130,664 System.DirectoryServices.dll
10/22/2021  06:49 PM           175,216 System.Drawing.Common.dll
08/21/2024  11:16 PM            90,168 System.IdentityModel.Tokens.Jwt.dll
10/22/2021  06:49 PM           122,480 System.IO.Packaging.dll
10/22/2021  06:51 PM            20,592 System.Security.Cryptography.ProtectedData.dll
10/22/2021  06:49 PM           104,048 System.Security.Permissions.dll
10/23/2022  12:54 PM           457,856 System.Text.Json.dll
10/22/2021  06:49 PM            25,712 System.Windows.Extensions.dll
02/12/2023  03:28 PM            33,792 TimeZoneConverter.dll
              67 File(s)     33,235,103 bytes
               3 Dir(s)  702,420,926,464 bytes free


What I have tried:

I have run the program locally on my computer and it runs without issue. I had put some Console.Writeline commands but it seems these things only run in debug mode.
Posted
Updated 26-Sep-24 14:45pm
v2

The easiest way to do it is if it's an .EXE or .DLL, copy the file.

The target machine also needs the .NET 6 runtime installed.
 
Share this answer
 
Usually you need to include all files from the output directory.
If you don't like that (very likely) you can try to publish as "self contained":
Application publishing - .NET | Microsoft Learn[^]
I would recommend to upgrade to .NET 8 if you plan to do this, as certain publishing options like trimming are not really matured in .NET 6.
 
Share this answer
 
Comments
Dave Kreskowiak 29-Sep-24 11:41am    
The down-side to "self-contained" is it can result is huge .EXE files.
RickZeeland 29-Sep-24 11:49am    
That depends, you can publish a framework-dependent app, but in this case you will have to pre-install the .NET 6 framework first. If you have a lot of separate .NET 6 applications this makes sense.
Dave Kreskowiak 29-Sep-24 12:10pm    
Yeah, I should have been a bit more specific.
RickZeeland 29-Sep-24 12:33pm    
To be honest, I still prefer to write my tools with the good old .NET 4.8 framework, it is a lot simpler. But I only develop for Windows of course, and don't need cross-platform availability. And I'm an old fart of course that does not want to change his habits :)
Dave Kreskowiak 29-Sep-24 12:47pm    
Same, but at work, we're rewriting a .NET 4.8 MVC/EF6 site in .NET 8.0 and EF7. We're constantly adding features to it so it's a bit like rebuilding the store while there's still customers in it.

It's slow work because dev work is not our primary job. We're basically doing this part-time whenever we can, and we're into the busy season at work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900