在错误的地方寻找

在错误的地方寻找

本文介绍了Asp.Net 在错误的地方寻找 web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个奇怪的问题 - 到目前为止,我只在一台机器上处理过这个应用程序.我已经将一个 asp.net 网络应用程序下载到客户办公室的开发机器上.

I've got a strange issue - Up until now I've only worked on this application on a single machine. I've downloaded an asp.net web app onto a dev machine in a clients office.

当我尝试通过 Visual Studio 在调试模式下运行应用程序时,我收到 500.19 错误 - 通常这意味着权限问题.在我注意到它正在寻找配置文件的目录之前,我经历了检查权限的动作.

When I try to run the application in debug mode through Visual Studio I get 500.19 error - typically this means a permission problem. I went through the motions of checking the permissions before I noticed the directory it was looking for the config file in.

错误中显示的配置文件"是

The 'Config File' shown on the error is

\\?\C:\Users\{my-name}\Documents\{project-name}\web.config

  • 然而正确的位置实际上是

    • however the correct location is actually

      C:\Users\admin\Documents\projects\{project-name}\web.config

      C:\Users\admin\Documents\projects\{project-name}\web.config

      有谁知道 web 配置的位置在哪里?我一直认为它只能在根目录中.

      Does anyone know where the location of the web config is specified? I had always assumed it could only ever be in the root directory.

      推荐答案

      事实证明这是升级到 Visual Studio 2015 的原因.

      As it turns out the cause of this was upgrading to Visual Studio 2015.

      新的 Visual Studio 有一个 .vs 文件夹,其中包含特定于项目实例的文件,而不是 .suo 文件.此处包含开发站点的根目录.

      Rather than a .suo file the new Visual Studio has a .vs folder with files specific to an instance of a project. The root directory of the development site is included in here.

      我删除了文件并将 .vs/* 添加到我的 .gitignore 文件中,没有更多问题.

      I deleted the files and added .vs/* to my .gitignore file and had no more problems.

      这篇关于Asp.Net 在错误的地方寻找 web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 09:09