What associated DLL's need to be included in order for a net6.0 console app to run?

William Thompson 120 Reputation points
2024-09-26T19:12:53.05+00:00

I have created a console app with Microsoft Visual Studio. I have put it into a directory off of my C drive and I have run it from the command line. This is the Release version of the .EXE and not the debug version.

One thing I have noticed is that when I run it from the command line, there are no text outputs even though the code is full of Console.Writeline("...") API commands. Does this mean the code runs and crashes.

Another thing I have notices is that when I gave the .EXE to my IT guy, when he ran it is that it asked for a DLL. What associated DLL's need to be included in order for a net6.0 console app to run?

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

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

I think I should say that I have made a similar post about this on another web forum, stackoverflow, in the interest of "full disclosure". But I think maybe this is a more microsoft oriented issue. So I am making this post here.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,963 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 65,661 Reputation points
    2024-09-26T21:04:44.3+00:00

    when you compile a .net 6.0 console app, you will get a bin folder with the app dll, an executable (that will load and run the app dll) plus any other dlls from optional nuget packages. to run the executable, you need the .net 6.0 runtime installed on the computer.

    if you want to run the app on another computer, you should use the publish command. an option to the publish is to include the .net runtime with the application. another option is to create a single file or publish to a folder. a standard publish looks like (assume app named console):

    console.deps.json
    console.dll
    console.exe
    console.pdb
    console.runtimeconfig.json
    

    note: your sample has additional nuget dlls.

    you can copy the folder to any computer with .net 6 runtime installed and run. if want you include the runtime you will need to specify the arch, and will get a much larger folder with a couple hundred additional runtime dll's

    additional note: .net 6 is almost at end of life (Nov 12, 2024), you should upgrade to .net 8

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.