.net.net-corevisual-studio-2022publish

Visual Studio 2022 Community : publish to folder not working


Visual Studio has a Publish feature, and one of the options is to publish to a folder - I use it to determine which files to include in my InnoSetup installer because I have a complex project and it's actually pretty hard to figure out which files to include.

I got a new computer, installed VS including the publish component. Everything runs without any errors, but no files appear in the destination folder :-(

Anyone else having this problem? It is very simple to setup so I have no idea how to fix.

enter image description here

Run publish, no errors and no files:

enter image description here


Solution

  • I met the same problem as you, and I can't publish it successfully using either absolute path or relative path.At present, my solution is to use the command line to execute the publishing command.About publish command.

    If your publish profile was named win-x64,

    it just like: dotnet publish -p:PublishProfile=win-x64

    Now I seem to have found an effective way.

    1. Upgrade your visual studio to the latest version.(As of my comment, the latest version of the Community Edition is 17.11.4)
    2. Delete the “bin” and “obj” folders that exist in your solution.
    3. Open windows Explorer to display hidden files or folders.
    4. Delete the hidden “.vs” folder.
    5. Reopen your visual studio.

    I’m sure this is a problem caused by the upgrade of a certain version of visual studio, Because the community version of vs can't roll back the version, I can't reproduce this Bug accurately. I use the above mentioned operations on two computers to solve this problem, and may be helpful.