【问题标题】:Why does Visual Studio prevent me from seeing the .csproj file, and is there a way to force it open?为什么 Visual Studio 阻止我看到 .csproj 文件,有没有办法强制打开它?
【发布时间】:2014-03-31 18:13:00
【问题描述】:

当我寻找我的 Web API 使用的端口号的硬编码来源时,我在项目的 *.csproj 文件中找到了它。然而,当我在 Visual Studio 的“查找结果”窗口中单击 2 次它时,它不会打开,而且我很粗暴地告知,“文档‘Bla*.csproj’已经作为项目或解决方案打开并且目前无法在编辑器中打开。"

要查看它,我必须用 Notepad++ 打开它,它显示了我想要的内容:

<WebProjectProperties>
  <UseIIS>True</UseIIS>
  <AutoAssignPort>True</AutoAssignPort>
  <DevelopmentServerPort>28642</DevelopmentServerPort>
  <DevelopmentServerVPath>/</DevelopmentServerVPath>
  <IISUrl>http://localhost:28642/</IISUrl>
  <NTLMAuthentication>False</NTLMAuthentication>
  <UseCustomServer>False</UseCustomServer>
  <CustomServerUrl>
  </CustomServerUrl>
  <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>

...但这有点痛苦。有没有更快的方法从项目/Visual Studio (2013) 中打开 .csproj 文件?

【问题讨论】:

    标签: visual-studio-2013 notepad++ csproj web-development-server


    【解决方案1】:

    要直接从 Visual Studio 编辑 .csproj(或任何其他项目文件),请执行以下操作:

    1. 在解决方案资源管理器中右键单击项目
    2. 选择“卸载项目”
    3. 项目现已卸载
    4. 再次右键项目,选择“Edit blah.csproj”
    5. 进行更改并保存
    6. 右键单击项目并选择“重新加载项目”以应用更改

    【讨论】:

    • 我不认为这真的比在 Notepad++ 中打开它更快。特别是,我希望在所有项目文件(不仅仅是一个)中都有一些搜索和替换功能。
    • 同意 - 我通常只是在 Notepad++ 中打开并编辑它,然后在 Visual Studio 中重新加载项目。
    • 在团队资源管理器中进行 Diff 比较时,在 VS 中卸载很有用。
    【解决方案2】:

    右键项目->卸载项目,然后再次右键->编辑

    【讨论】:

      猜你喜欢
      • 2010-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多