.pro文件生成.sln_VB.NET解决方案和项目文件“ sln”和“ vbproj”

.pro文件生成.sln

The whole topic of projects, solutions, and the files and tools that control them is something that is seldom explained.

项目,解决方案以及控制它们的文件和工具的整个主题很少说明。

扔食物 ( Throwing Food )

One of the big advantages of the way Microsoft has designed solutions and projects is that a project or solution is self-contained. A solution directory and its contents can be moved, copied, or deleted in Windows Explorer. A whole team of programmers can share one solution (.sln) file; a whole set of projects can be part of the same solution, and the settings and options in that .sln file can apply to all of the projects in it. Only one solution can be open at one time in Visual Studio, but a lot of projects can be in that solution. The projects can even be in different languages.

Microsoft设计解决方案和项目的方式的一大优势是,项目或解决方案是独立的。 解决方案目录及其内容可以在Windows资源管理器中移动,复制或删除。 整个程序员团队可以共享一个解决方案(.sln)文件; 整个项目集可以是同一解决方案的一部分,.sln文件中的设置和选项可以应用于其中的所有项目。 在Visual Studio中一次只能打开一个解决方案,但是该解决方案中可以包含许多项目。 这些项目甚至可以使用不同的语言。

You can get a better understanding of just what a solution is by creating a few and looking at the result. A "Blank solution" results in a single folder with just two files: the solution container and the solution user options. If you use the default name, you'll see:

通过创建一些解决方案并查看结果,您可以更好地了解解决方案是什么。 “空白解决方案”导致只有两个文件的单个文件夹:解决方案容器和解决方案用户选项。 如果使用默认名称,则会看到:

添加隐私 ( Add Privacy )

The main reason you can create a blank solution is to allow project files to be created independently and included in the solution. In large, complex systems, in addition to being part of several solutions, projects can even be nested in hierarchies.

可以创建空白解决方案的主要原因是允许独立创建项目文件并将其包含在解决方案中。 在大型,复杂的系统中,除了作为多个解决方案的一部分外,项目甚至可以嵌套在层次结构中。

The solution container file, interestingly, is one of the few text configuration files that isn't in XML. A blank solution contains these statements:

有趣的是,解决方案容器文件是少数几种不在XML中的文本配置文件之一。 一个空白解决方案包含以下语句:

It might as well be XML... it's organized just like XML but without the XML syntax. Since this is just a text file, it's possible to edit it in a text editor like Notepad. For example, you can change HideSolutionNode = FALSE to TRUE and solution won't be shown in Solution Explorer anymore. (The name in Visual Studio changes to "Project Explorer" too.) It's fine to experiment with things like this as long as you're working on a strictly experimental project. You should never change configuration files manually for a real system unless you know exactly what you're doing, but it's fairly common in advanced environments to update the .sln file directly rather than through Visual Studio.

它也可能是XML ...就像XML一样组织,但是没有XML语法。 由于这只是一个文本文件,因此可以在文本编辑器(如记事本)中对其进行编辑。 例如,您可以将HideSolutionNode = FALSE更改为TRUE,并且解决方案将不再显示在解决方案资源管理器中。 (Visual Studio中的名称也更改为“ Project Explorer”。)只要您正在执行严格的实验项目,就可以尝试进行类似的实验。 除非您确切知道自己在做什么,否则切勿为实际系统手动更改配置文件,但是在高级环境中,直接更新.sln文件而不是通过Visual Studio进行更新是相当普遍的。

The .suo file is hidden and it's a binary file so it can't be edited like the .sln file. You will normally only change this file using the menu options in Visual Studio. Moving up in complexity, check out a Windows Forms Application. Even though this might be the most elementary application, there are a lot more files.

.suo文件是隐藏的,它是一个二进制文件,因此无法像.sln文件一样进行编辑。 通常,您只能使用Visual Studio中的菜单选项来更改此文件。 随着复杂性的提高,请签出Windows Forms应用程序。 即使这可能是最基本的应用程序,也有很多文件。

In addition to a .sln file, the Windows Forms Application template also automatically creates a .vbproj file. Although the .sln and .vbproj files often useful, you might notice that they're not shown in the Visual Studio Solution Explorer window, even with the "Show All Files" button clicked. If you need to work with these files directly, you have to do it outside of Visual Studio.

除了.sln文件之外,Windows Forms应用程序模板还自动创建.vbproj文件。 尽管.sln和.vbproj文件通常有用,但是您可能会注意到即使单击“显示所有文件”按钮,它们也不会显示在Visual Studio解决方案资源管理器窗口中。 如果需要直接使用这些文件,则必须在Visual Studio之外进行操作。

Not all applications need a .vbproj file. For example, if you select "New Web Site" in Visual Studio, no .vbproj file will be created. Open the top level folder in Windows for the Windows Forms Application and you'll see the four files that Visual Studio doesn't show. ssuming the default name again, they are: The .sln and the .vbproj files can be useful for debugging difficult problems. There's no harm in looking at them and these files tell you what is really going on in your code.

并非所有应用程序都需要.vbproj文件。 例如,如果您在Visual Studio中选择“新网站”,则不会创建.vbproj文件。 在Windows中打开Windows窗体应用程序的顶级文件夹,您将看到Visual Studio未显示的四个文件。 再次使用默认名称,它们是:.sln和.vbproj文件可用于调试棘手的问题。 查看它们没有什么害处,并且这些文件告诉您代码中真正发生的事情。

As we have seen, you can also edit .sln and .vbproj files directly although it's usually a bad idea unless there is no other way to do what you need. But sometimes, there is no other way. For example, if your computer is running in 64-bit mode, there isn't a way to target a 32-bit CPU in VB.NET Express, for example, to be compatible with the 32-bit Access Jet database engine. (Visual Studio provides a way in the other versions), but you can add the following:

正如我们所看到的,您也可以直接编辑.sln和.vbproj文件,尽管通常这是一个坏主意,除非没有其他方法可以满足您的需要。 但是有时候,别无他法。 例如,如果您的计算机以64位模式运行,则无法将VB.NET Express中的32位CPU定位为目标,例如,使其与32位Access Jet数据库引擎兼容。 (Visual Studio在其他版本中提供了一种方法),但是您可以添加以下内容:

To the elements<propertygroup.. .=:l"" "=""> in the .vbproj files to get the job done. Both the .sln and .vbproj file types are normally associated with Visual Studio in Windows. That means that if you double-click either of them, Visual Studio opens. If you double-click a solution, the projects in the .sln file are opened. If you double-click a .vbproj file and there is no .sln file (this happens if you add a new project to an existing solution) then one is created for that project.

到.vbproj文件中的elements <propertygroup ..。=:l“” =“ =”“>完成工作。.sln和.vbproj文件类型通常都与Windows中的Visual Studio关联。这意味着如果您双击其中的任何一个, Visual Studio都会打开。如果您双击解决方案,则.sln文件中的项目会打开。如果您双击.vbproj文件而没有.sln文件(这种情况会发生如果您将一个新项目添加到现有解决方案中,则会为该项目创建一个。

翻译自: https://www.thoughtco.com/the-vbproj-and-sln-files-3424258

.pro文件生成.sln

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值