What's the point of unloading project in Visual Studio?

天大地大妈咪最大 提交于 2021-01-27 04:10:19

问题


I'm reading a book about MVC ASP.NET, there are some hidden project setup that you can only modify by 'unload' the whole first(then all the structure gone), then after clicking 'edit', change the xml tag value.

That reminds me to ask: why we need to unload the project before we modify the config file? Can anybody tell me the meaning of unloading project?

Why not just open the folder location and change by Notepad?


回答1:


It can be useful to unload a project from a solution while resolving circular dependencies between projects or conflicts with different versions of the .NET framework between projects.

It is considerably more difficult and error-prone to directly edit the configuration files with Notepad.




回答2:


Editing your project file is not something you are going to do often. By making you unload the project before editing it, they are making it hard on purpose. This will keep you from accidentally changing something.

Microsoft tries to make a habit of protecting us from ourselves. For example

  1. Each case must break in a switch.
  2. unsafe keyword is required if you are doing pointer manipulation.
  3. new keyword to hide inherited members.



回答3:


Assuming your talking about the project file, it helps when editing in Visual Studio because you get all the syntax highlighting, xml schema support, etc. Sure this could be done without unloading, but I guess Microsoft are trying to force you into a particular workflow.



来源:https://stackoverflow.com/questions/18134170/whats-the-point-of-unloading-project-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!