Prevent aspx source file in App_Code

May 30, 2011 at 12:53 PM

Hello

I 've tried to make my first NuGet package, but with no succes. I have simple aspx (webforms) pages with a source file attached. But when I install the package the source files of the pages are installed in the App_Code folder. How can I prevent this?

Thanks in advance

Developer
May 30, 2011 at 7:12 PM

Might be a bug on our part. Can you open a bug with repro steps?

May 31, 2011 at 6:46 AM

The current logic is that in web sites, we put sources files under App_Code, while for web apps, we leave them where the package says. But this does break for aspx code behind files, which shouldn't be in App_Code.

One approach is to say that if we see Foo.Bar.Baz.cs and Foo.Bar.Baz is also in the package, then *don't* move to App_Code in web sites. This should generally take care of the code behind scenarios.

Though as an aside, code behind in web sites and web apps works a bit differently, so it may be tricky to have a package that works with both. Well, technically anything that works in a Site works in an App, but it won't follow the 'correct' compilation pattern.

Developer
Jun 1, 2011 at 8:59 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jun 1, 2011 at 2:09 PM

Thanks for making an issue of this discussion. I found it weird that this is the first time this problem occurred. I have tried to find a solution but with no result.

Jun 1, 2011 at 5:01 PM

The special App_Code support was added in 1.3 (I think), so you would not have seen this with earlier nuget versions.