Forum


HomeHomePremiumPremiumDevelopmentDevelopmentExcluding files from a buildExcluding files from a build
Previous
 
Next
New Post
7/13/2017 5:57 AM
 

Hello,

 

I am trying to prevent certain files in a DNN module from being deployed. These are mainly SVG files which I want to keep in the development project but don't want them to overwrite the files on other installations.

I assumed that they wouldn't be deployed if they were excluded from the project, but I was wrong.

Under Project properties> Package/Pubish Web > 'items to deploy' was set to:

'Only files needed to run this application'

so I tried changing it to:

'All files in this project'


The files are still deployed even though they're excluded from the project.

So I then included the files into the project (which seems counter-intuitive) so I could set their build action to none.


But none of this works, the files are deployed every time.

I am not famiilar with the build process for DNN, is it possible that this overrides Visual Studio's settings?

 

Has anyone found a way to overcome this?

 

Best Regards,

 

Steve

 
New Post
7/14/2017 5:30 AM
 

Hi Steve,

By "deployed" do you mean inside the "Install.zip" file that gets created?

If so, you should check the BuildScripts for your solution. The template I have used in the past for DNN modules includes a folder called "BuildScripts" - Inside of it there is a file called "ModulePackage.targets" - It is there where you can add or remove files from your deployed zip install. I don't know the ins and outs of the sintax, but open it up on a text editor and with a bit of effort you should be able to figure out and exclude SVG files from getting added to your deployment package.

Cheers,

Aderson

 
New Post
7/14/2017 10:46 AM
 

Hi Aderson,

Thank you for your reply.

Yes I do.

Thank you for your tip. I don't understand the syntax of the 'ModulePackage.targets' file but I've tried all the combinations I can think of to exclude the file which is contained in a sub directory 'images\MyMenu\Templates', for example:

<SourceInclude Include="**\*.svg" Exclude="**\images\MyMenu\Templates;" />   

<SourceInclude Include="**\*.svg" Exclude="**\images\MyMenu\Templates\*.svg;" />  

<SourceInclude Include="**\*.svg" Exclude="**\images\MyMenu\Templates\*.*;" />    

<SourceInclude Include="**\*.svg" Exclude="**\images\MyMenu\Templates\**;" />  

 

But none of them have any affect. I can't find any decent information on the syntax either, so am not sure what to do.

If the worst comes to the worst, I may just change my app to handle it, more work but at least i know what I'm doing there.

Best Regards,

Steve

 
New Post
7/16/2017 4:12 PM
 

Hi Steve,

I haven't tried but it seems what you did should have worked.

There is a warning on top of that file. It says:

"REMEMBER THAT IF YOU MODIFY THE TARGETS FILE YOU NEED TO CLOSE/OPEN THE PROJECT FOR THE CHANGES TO TAKE EFFECT"

Have you done that?

Thank you,

Aderson

 
New Post
7/16/2017 11:49 PM
 

Hi Aderson,

 

Thank you for following up on this. 

 

Yes, I noticed that too, I closed and opened Visual Studio before testing each change.

 

Best Regards,

 

Steve

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentExcluding files from a buildExcluding files from a build



Try FREE
30 days money back guaranteed