How to enable custom folders when publishing an MVC application?

I have a “Downloads” folder with logos inside. I would like the VS2012 publication with one click to include this folder. This is currently not the case.

How can i achieve this?

Thanks for any help.

+10
asp.net-mvc visual-studio-2012 asp.net-mvc-3
source share
5 answers

I believe that you need to set the "Build Action" folder to "Content":

What are the various Build action settings in the properties of a Visual Studio project, and what do they do?

+5
source share

Go to Project Properties> Pack / Publish Online

Then select the configuration combination that you want to configure.

Below you have items to deploy. I just checked here " All files in this project folder " and everything was published.

The only drawback is that everything is deployed, I do not know if this is what you want.

+4
source share

I did this for a web api project (not a dot dot core), in which Angular 6 had an external interface. My visual studio version was 2017.

I created a wwwroot folder which I wwwroot corner files using custom build actions, and this folder was not included in my project.

I edited the project file and added these lines.

 <PropertyGroup> <PipelineCollectFilesPhaseDependsOn> CustomCollectFiles; $(PipelineCollectFilesPhaseDependsOn); </PipelineCollectFilesPhaseDependsOn> </PropertyGroup> <Target Name="CustomCollectFiles"> <Message Text="Inside of CustomCollectFiles" Importance="high" /> <ItemGroup> <_CustomFiles Include="wwwroot\**\*" /> <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"> <DestinationRelativePath>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath> </FilesForPackagingFromProject> </ItemGroup> </Target> 
+4
source share

in my case, I created a folder in the bin folder and had to include this folder in the publication. and this code works for me.

 <Target Name="CustomCollectFiles"> <ItemGroup> <_CustomFiles Include=".\bin\Dlls\**\*" /> <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"> <DestinationRelativePath>bin\Dlls\%(RecursiveDir)%(Filename)%(Extension) </DestinationRelativePath> </FilesForPackagingFromProject> </ItemGroup> </Target> <PropertyGroup> <CopyAllFilesToSingleFolderForPackageDependsOn>CustomCollectFiles; ;</CopyAllFilesToSingleFolderForPackageDependsOn> <CopyAllFilesToSingleFolderForMsdeployDependsOn>CustomCollectFiles; ;</CopyAllFilesToSingleFolderForMsdeployDependsOn> </PropertyGroup> 

hope this helps someone.

0
source share

first click on the show all icon, then turn on all files that are darkened one by one to project

0
source share

All Articles