What are the Web.Debug.config and Web.Release.Config files for?

前端 未结 4 1954
时光取名叫无心
时光取名叫无心 2020-11-28 22:55

I just upgraded to Visual Studio 2010 and MVC 2.0 and I noticed the Web.config has two additional files attached to it? Are these files used to specify debug and release spe

4条回答
  •  攒了一身酷
    2020-11-28 23:36

    That was something long needed in VS. Unfortunately there seems to be a problem with the implementation. For example consider this scenario (VS.2010 Ultimate, all SP):

    Web.Config

    • No connectionStrings section
    • Full Membership User/Role/etc. Provider configuration using connectionStringName="test"

    Web.Release.Config

    • No membership configuration (already specified in main web.config)
    • connectionStrings section including the CS named "test"

    Web.Debug.Config

    • No membership configuration (already specified in main web.config)
    • connectionStrings section including the CS named "test"

    When executing the application gives the following error:

    The connection name 'test' was not found in the applications configuration or the connection string is empty.

    In other words, because the connection string elements are in the Release/Debug designer files and used by configuration elements in the main (Web.config) file, it is unable to resolve it.

提交回复
热议问题