Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing is getting excluded #7

Open
amithgeorge opened this issue Oct 17, 2013 · 8 comments
Open

Nothing is getting excluded #7

amithgeorge opened this issue Oct 17, 2013 · 8 comments

Comments

@amithgeorge
Copy link

I have an Asp.net MVC 4 web project. I installed PublishIgnore 1.0.5 using Nuget. It created the .targets and .ignore files. I edited the publish.ignore file to exclude the App_Readme\ folder. I then published the project to my desktop (ie, publish to a local folder using the FileSystem option). The publishing process deletes all existing files before publishing.

The publish location contains the App_Readme folders and its files. Even the .targets and publish.ignore files are present.

My publish.ignore currently looks like this

# You can declare files/folders that should be ignored here. For example

# how to exclude files
#   sample.html
#   sayed*.html
#   \sayed.html

# how to exclude folders
#   admin\
#   private/

# prevents this file from being published
publish.ignore
*.wpp.targets
App_Readme/
@amithgeorge
Copy link
Author

Using the ExcludeFoldersFromDeployment tag as demonstrated in the post Web Deployment: Excluding Files and Folders via the Web Application’s Project File I was able to exclude the App_Readme folder.

I had originally tried the ExcludeFromPackageFiles mentioned in http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx, but that also didn't work for me. Just mentioning it, incase PublishIgnore makes use of this tag.

@sayedihashimi
Copy link
Member

Thanks, I'll investigate it. Can you tell me what version of Visual Studio are you using?

@amithgeorge
Copy link
Author

I am using VS 2012. Its an Asp.Net MVC 4 project. I have .Net 4.5 installed. So it must be using the corresponding version of MS Build.

@bchavez
Copy link

bchavez commented Dec 5, 2013

Out of the box (via NuGet), this wasn't working for me either.

I got it to work by using the "-Pre" release NuGet version:

Install-Package PublishIgnore -Pre
// Currently PublishIgnore 1.0.6-beta

and by adding ls.pubignore.wpp.targets targets file to my .pubxml file:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
      .....
    <publishUrl>./CIBuild</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>
  <Import Project="..\..\ls.pubignore.wpp.targets"/> <!-- MUST BE IMPORTED HERE -->
</Project>

Otherwise, a straight *.wpp.targets drop in doesn't work.

@ansorg
Copy link

ansorg commented Sep 11, 2014

tried waht @bchavez suggests but even then nothing gets ignored; VS2013.
Falling back to ExcludeFoldersFromDeployment

@AArkiane
Copy link

EDIT :
Hum this is weird but after a new reboot of VS the package starts working!? So it seams to be ok for me on my new projects by now...

Original message:
Same problem here, it's weird because I successfully used this package on one project (classic asp, not .Net), but I can not use it on my new projects, publish.ignore content seems to be never took in count.
MVC4 projets on VS2013 Express.

I want to exclude a folder and it's content:

  • root
    • [...]
    • Logs/log_return.log
    • [...]

Tried:
logs/
logs
Logs/
Logs
*.log

Then:
logs/.log
logs_.log
Logs/
.log
Logs_.log

Then:
logs/log_return.log
logs\log_return.log
Logs/log_return.log
Logs\log_return.log

Nothing works...

Any idea?

Regards,
Anthony

@sayedihashimi
Copy link
Member

Sorry for the delay. You should update to the latest which is 1.0.6-beta. I have just unlisted 1.0.5 to make that more clear.

Can you tell me if the issue continues using 1.0.6-beta?

You shouldn't have to edit the .pubxml file to import the .wpp.targets file. In some cases _you may need to restart Visual Studio_. Usually Visual Studio will detect the .wpp.targets file and pick it up on the next publish but in some cases it may not. Try restarting VS to see if that helps.

@joelbert
Copy link

joelbert commented Jan 8, 2015

I'm using 1.0.6-beta in VS 2013.4 and having the same issue. If I start the line with a forward slash or backslash I can ignore a file from the root folder, for example:

/publish.ignore

But without the slash at the start, the file is deployed. Also, I'd like to prevent all files with a certain extension from being deployed, for all folders. This is how I attempted to do that for one file type:

*.sprite

But this isn't working. Is this wildcard syntax supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants