0

Should the FactoredProfileProvider.cs be placed in App_Code only? What is the standard way to do it? Can I put it under an Area that handles all accounts?

Blaise
  • 18,108
  • 20
  • 89
  • 154

1 Answers1

0

Should the FactoredProfileProvider.cs be placed in App_Code only?

Absolutely not. The App_Code folder should never be used with the web applications model which is what ASP.NET MVC uses. This folder is used only with websites. See web application vs website. So in ASP.NET MVC you could place this file wherever you want, like for example you could create yourself a subfolder called ProfileProviders and put it inside.

Community
  • 1
  • 1
Darin Dimitrov
  • 960,118
  • 257
  • 3,196
  • 2,876
  • Is it possible to put the provider in a class library? And of course, we need to copy all the connection string and related settings from web.config into the new app.config in the class library. – Blaise Jan 24 '12 at 21:27
  • 1
    @Blaise you wouldn't copy the settings into an app.config for a class library, they won't be used at runtime. The main applications config is used. – Adam Tuliper - MSFT Jan 24 '12 at 21:29
  • @Blaise, of course that you can put the provider in a seprate class library but as Adam said, there's no such thing as app.config for a class library. The settings must remain in the main application configuration file which in the case of ASP.NET MVC is the web.config. – Darin Dimitrov Jan 24 '12 at 21:46