Home > Software engineering >  Deploying Static Private Files in .NET5
Deploying Static Private Files in .NET5

Time:09-10

My project's sln file is located at C:\ProjectName\, and the API project is located at C:\ProjectName\Project.Api\.

I have a static folder, in which I store some files that are needed for a successful build and launch which is located at this path C:\ProjectName\Project.Api\LaunchFiles\launchFileOne.json. But when I get a build, the bin\debug\net5.0\ folder does not have the LaunchFiles\ directory. In order for me to successfully do a deploy of this app, I need to have the LaunchFiles\ directory deployed under bin\debug\net5.0.

How can I achieve this? I cannot use wwwroot for this purpose since these files need to be private and not open to access. IIS directory browsing will be off, so no problem on that case.

CodePudding user response:

To copy some kind of arbitrary data file with your program you need to first add it to the solution, then set the Copy to Output Directory-property. This is "do not copy" by default.

enter image description here

  • Related