0

I have a working visual studio 2019 project with a simple nuget package, where if I right click 'ClassLibrary2' and click 'pack' it packages my project into a NuGet package

enter image description here

I want to package this folder NxTestware, when I include the folder in my project and try to pack again, it results in errors that come from inside the source folder, like it is trying to build the contents of that folder

enter image description here

Is there some way in visual studio I can tell it that when I click 'pack', do not build the contents of the NxTestware folder?

POVR2
  • 87
  • 10

1 Answers1

0

After trying I can't reproduce your issue on my side, please check your project's csproj file, and refer to this document: How to: Exclude files from the build.

Peng Ge
  • 239
  • 2
  • 5
  • In the link you shared there examples with xml code that i assume is inside csproj files. but where can I find this csproj ? is it created by default in visual studio? or do i have to make it manually? I cant find the csproj in my solutions explorer – POVR2 May 05 '22 at 13:26
  • nevermind i was able to do so here https://stackoverflow.com/questions/5129090/how-to-edit-csproj-file trying it now – POVR2 May 05 '22 at 13:30
  • I added `` to my project file, but it causes an error `The attribute "Exclude" in element is unrecognized.` – POVR2 May 05 '22 at 13:33
  • Try PreserveNewest – Peng Ge May 06 '22 at 08:55
  • I got it working with ` ` – POVR2 May 06 '22 at 14:14