2

In my repository I have the next structure:

Common
    \PublishProfiles
        \Profile.pubxml
Solution1
    \WebProject1
Solution2
    \WebProject2

I want to share Profile.pubxml between two projects. Everything seems to work fine when I use msbuild with PublishProfileRootFolder property, but when I use "Publish" button from VS2019 it behaves like there is no profile and it seems reasonable, since it has no information about my shared profile.

I can't find any information on how VS2019 actually resolves publishing profiles while publishing from VS itself, so I've tried different things:

  1. Creating symbolic link to Profile.pubxml from Solution1\WebProject1\Properties\PublishProfiles
  2. "Add Existing Item"(Add file as Link) to the project

Seems that it only works when there is Profile.pubxml file inside Solution1(2)\WebProject1(2)\Properties\PublishProfiles folder.

Any other ideas on how to make it work? Or is it impossible?

Smooyk
  • 389
  • 4
  • 20

1 Answers1

0

Referencing shared publishing profile in Visual Studio 2019

Actually, it is designed by that. When you click Publish button, it will find the xxx.pubxml file under project folder\Properties\PublishProfiles and if the file does not exist under that path, VS will ask you to create a new file which is what happened to you.

Suggestion

So it is impossible to do other operation and you should put the file under project folder\Properties\PublishProfiles if you use Publish button to publish your project.

In addition, if you still want your idea, you could suggest a feature on our User Voice Forum.The Team will consider it carefully and hope they will give you a satisfactory reply.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41