Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude a folder from a nuget package

Tags:

I'm using Octopack / Nuspec file to build my nuget package.

I would like to exclude certain folders which exist in the project. e.g. the "obj" file. I've been trying to get the exclude tag to work, but haven't had any luck. The nuget file builds, but the folder is still there.

Sadly, all the examples on the net specific file types and not folder.

<?xml version="1.0"?> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">   <metadata>     <id>Foo</id>     <title>Foo</title>     <version>$version$</version>     <authors>NA</authors>     <owners>NA</owners>     <licenseUrl>http://Foo</licenseUrl>     <projectUrl>http://Foo</projectUrl>     <requireLicenseAcceptance>false</requireLicenseAcceptance>     <description>Foo</description>     <releaseNotes>NA</releaseNotes>   </metadata>   <files>     <file src="obj\**\*.*" exclude="*.*" />   </files> </package> 
like image 875
Kye Avatar asked Jan 22 '13 06:01

Kye


People also ask

What is .NuGet folder?

The global-packages folder is where NuGet installs any downloaded package. Each package is fully expanded into a subfolder that matches the package identifier and version number. Projects using the PackageReference format always use packages directly from this folder.

Where is .NuGet folder located?

The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).

What is a Nuspec file?

A . nuspec file is an XML manifest that contains package metadata. This manifest is used both to build the package and to provide information to consumers. The manifest is always included in a package.


1 Answers

I needed to create a WebApplication, but deploy it as a standard ASP.NET website using "CodeFile" attributes.

This was basically to update a page in the standard ADFS login site.

<files>   <file src="**" exclude="**\*.dll;**\*.designer.cs;**\*.csproj;**\*.pdb;**\*.user;**\*.vspscc;bin\*.cs;bin\*.aspx;bin\*.config;bin\*.asax;bin\*.pubxml" /> </files> 
like image 160
Kye Avatar answered Sep 21 '22 15:09

Kye