“prompt to build” 和 “always build” 之间的区别

huangapple go评论83阅读模式
英文:

The difference between prompt to build and always build

问题

我有一个使用asp.net web form开发的项目。
最近,我们的团队遇到了一个新问题,那就是如果在项目的核心层进行更改,项目的构建时间几乎需要10分钟。
例如,如果在核心层中的代码是 string a = "sad" ,项目的构建时间会增加
当我将选项设置为从路径Debug-->Options-->Projects and Solutions-->Build And Run-->On Run , when Projects are out of date时,构建项目的时间减少了,但并没有减少很多。
我想知道Prompt to buildAlways build之间有什么区别?这种变化如何影响我的项目?

注意:在Debug--> Debug Properties --> Build中,我将"Before running startup page"设置为Build Page,然后问题解决了,项目在一秒钟内构建完成!
我真的不知道发生了什么!这些变化是什么意思,是否会影响项目构建过程并更改文件并应用它们?

英文:

I have a project developed with asp.net web form.
Recently, our team encountered a new problem, and that is that if a change is made in the core layers of the project, the build time of the project takes almost 10 minutes.
For example, if in the core layer, the code string a = "sad"; , the project build time will increase.
When I set the option to Prompt to build from the path Debug-->Options-->Projects and Solutions-->Build And Run-->On Run , when Projects are out of date, the time to build the project is reduced but not al lot.
I wanted to know what is the difference between Prompt to build and Always build? And how does this change affect my project?

Note: In Debug--> Debug Properties --> Build , I set "Before running startup page" to Build Page , then problem solved and project build in a second!
really I do not know what happen ! and What do these changes do and does it affect the project build process and change files and apply them or not?

答案1

得分: 0

  1. Prompt to build: 当你选择“提示构建”时,Visual Studio将在运行项目之前询问你是否要构建项目。如果你选择构建,Visual Studio将检查自上次构建以来是否对项目进行了任何更改,如果有,它将在运行项目之前执行构建。此选项允许你控制构建过程何时发生,并且你可以选择跳过构建,如果你认为它不是必要的。

  2. Always build: 选择“始终构建”时,Visual Studio将在运行项目之前自动执行构建,无论是否进行了任何更改。此选项确保每次运行项目时都会构建项目,无论项目文件的状态如何。当你希望确保最新的代码更改始终反映在执行的应用程序中时,选择“始终构建”可以节省手动触发构建的额外步骤。另一方面,如果你更喜欢控制构建过程发生的时间,或者只想在认为有必要时进行构建,选择“提示构建”允许你根据具体情况做出决定。

构建页面:当你编写错误的代码并选择“提示构建”时,例如int a = "1";,构建过程不会出现错误(不会出现编译错误),但在执行时会发生错误(运行时错误发生)。

如果你选择使用“始终构建”来构建页面,问题就解决了,但我仍然不明白构建网站和构建页面之间有什么区别。

英文:
  1. Prompt to build: When you have "Prompt to build" selected, Visual Studio will ask you whether to build the project before running it. If you choose to build, Visual Studio will check if any changes have been made to the project since the last build, and if so, it will perform a build before running the project. This option allows you to control when the build process occurs, and you can choose to skip the build if you believe it is not necessary.
  2. Always build: With "Always build" selected, Visual Studio will automatically perform a build before running the project, regardless of whether any changes have been made. This option ensures that the project is built every time you run it, regardless of the state of the project files. It can be useful when you want to ensure that the latest code changes are always reflected in the executed application.

The choice between "Prompt to build" and "Always build" depends on your workflow and preferences. If you frequently make changes to your project and want to ensure that the most up-to-date version is always built and run, selecting "Always build" can save you the extra step of manually triggering a build. On the other hand, if you prefer more control over when the build process occurs, or if you only want to build when you think it is necessary, "Prompt to build" allows you to make that decision on a case-by-case basis.

Build Page : When you write wrong code and you are on prompt to build, for example int a ="1"; , an error does not occur during build (compile error does not occurs) and an error occurs during execution(RunTime error occurs).

If you select build page with always build , the problem solved , but still I can not understand what is different between build website and build page

huangapple
  • 本文由 发表于 2023年6月13日 15:26:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76462572.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定