Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024

I figured this out. For a DLL you must use the same directory for Output Directory and Intermediate directory:

I made these the same and now it is working. (This is from Project Property file.)

  <PropertyGroup>
    <OutDir>$(SolutionDir)Build\$(Configuration)\$(ProjectName)\</OutDir>
    <IntDir>$(SolutionDir)Build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>

Also ending up have to make sure: (This is from Project Property file.)

      <ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>

For the compile side.

Link side is default as well.

Compiler and Linker must have different names for "ProgramDataBaseFileName"

I have not worked with DLL's as much. I have never had this problem before with static libraries are exe.

Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.

Tutorial: Publish a .NET console application using Visual Studio

  • Bài viết
  • 08/25/2023

Trong bài viết này

This tutorial shows how to publish a console app so that other users can run it. Publishing creates the set of files that are needed to run your application. To deploy the files, copy them to the target machine.

Prerequisites

  • This tutorial works with the console app that you create in Create a .NET console application using Visual Studio.

Publish the app

  1. Start Visual Studio.
  2. Open the HelloWorld project that you created in Create a .NET console application using Visual Studio.
  3. Make sure that Visual Studio is using the Release build configuration. If necessary, change the build configuration setting on the toolbar from Debug to Release.
    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024
  4. Right-click on the HelloWorld project (not the HelloWorld solution) and select Publish from the menu.
    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024
  5. On the Target tab of the Publish page, select Folder, and then select Next.
    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024
  6. On the Specific Target tab of the Publish page, select Folder, and then select Next.
    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024
  7. On the Location tab of the Publish page, select Finish.
    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024
  8. On the Publish profile creation progress page, select Close.
  9. On the Publish tab of the Publish window, select Publish.
    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024

Inspect the files

By default, the publishing process creates a framework-dependent deployment, which is a type of deployment where the published application runs on a machine that has the .NET runtime installed. Users can run the published app by double-clicking the executable or issuing the dotnet HelloWorld.dll command from a command prompt.

In the following steps, you'll look at the files created by the publish process.

  1. In Solution Explorer, select Show all files.
  2. In the project folder, expand bin/Release/net7.0/publish.

    Lỗi không tìm thấy file pdb của visual studio 2023 năm 2024
    As the image shows, the published output includes the following files:

    • HelloWorld.deps.json This is the application's runtime dependencies file. It defines the .NET components and the libraries (including the dynamic link library that contains your application) needed to run the app. For more information, see Runtime configuration files.
    • HelloWorld.dll This is the version of the application. To execute this dynamic link library, enter dotnet HelloWorld.dll at a command prompt. This method of running the app works on any platform that has the .NET runtime installed.
    • HelloWorld.exe This is the version of the application. To run it, enter HelloWorld.exe at a command prompt. The file is operating-system-specific.
    • HelloWorld.pdb (optional for deployment) This is the debug symbols file. You aren't required to deploy this file along with your application, although you should save it in the event that you need to debug the published version of your application.
    • HelloWorld.runtimeconfig.json This is the application's runtime configuration file. It identifies the version of .NET that your application was built to run on. You can also add configuration options to it. For more information, see .

Run the published app

  1. In Solution Explorer, right-click the publish folder, and select Copy Full Path.

Open a command prompt and navigate to the publish folder. To do that, enter cd and then paste the full path. For example: