I am trying to make a NuGet package, with two .ascx and two .ascx.cs files. All four files are in the same folder, not in the app_code folder. Now when I make a Nuget package, it put’s the .cs’s inside the app_code folder, giving me the "does not contain definition for...are you missing a using directive or assembly reference?" error for the .cs files trying to reference controls on the .ascx. Now what I want to know is two things:
-
how can I make a reference from the .ascx.cs file to the .ascx when they’re in different folders so I can program the controls again?
-
how can I override the folder location for .cs files with NuGet? I tried using the
<files>tag like this:<files><file src="somepath\*.ascx.cs" target="somepath"/></files>
but when I open the package with 7zip and look at the .nuspec there, it appears NuGet just ignores that.
Thanks in advance!
(Taken from David Fowler’s comment, so this can be marked as answered)
This is a bug in NuGet and has now been fixed 🙂