成功构建后,web.config 中的 ASP.NET 配置文件部分消失

发布于 2024-07-13 09:59:31 字数 1062 浏览 3 评论 0原文

我正在尝试向 ASP.NET web.config 文件添加一个部分以使用默认配置文件提供程序。 以下是我在 system.web 节点中添加到 web.config 中的内容:

<profile defaultProvider="AspNetSqlProfileProvider">
        <providers>
            <clear/>
            <add name="AspNetSqlProfileProvider"
                 type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionStringName="ApplicationServices"
                 applicationName="/"
            />
        </providers>
        <properties>
            <group name="UserDetails">
                <add name="FirstName" />
                <add name="LastName" />
                <add name="BirthDate"
                     type="System.DateTime" />
            </group>
        </properties>
    </profile>

我可以成功构建网站,但一旦完成,我就会收到提示,表明 web.config 已在编辑器外部修改,我是否想要重新加载它。 我单击“是”,配置文件部分就会消失。 web.config 文件中的其他所有内容都保持不变并正常运行。

您知道在哪里寻找解决此问题的方法吗? 谢谢!

I'm trying to add a section to an ASP.NET web.config file for using the default profile provider. Here's what I'm adding to web.config in the system.web node:

<profile defaultProvider="AspNetSqlProfileProvider">
        <providers>
            <clear/>
            <add name="AspNetSqlProfileProvider"
                 type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionStringName="ApplicationServices"
                 applicationName="/"
            />
        </providers>
        <properties>
            <group name="UserDetails">
                <add name="FirstName" />
                <add name="LastName" />
                <add name="BirthDate"
                     type="System.DateTime" />
            </group>
        </properties>
    </profile>

I can build the website successfully, but as soon as it completes I get the prompt that web.config has been modified outside of the editor and do I want to reload it. I click Yes, and the profile section disappears. Everything else in the web.config file remains intact and functioning correctly.

Any ideas of where to look for troubleshooting this issue? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七度光 2024-07-20 09:59:31

听起来您正在网站根目录中编辑输出配置文件,并且构建会被 ASP.NET 项目中保存的未经编辑的配置覆盖。

It sounds like you are editing the output config file in the Web site's root and that the build is overwriting with the unedited config held in the ASP.NET project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文