单击解决方案资源管理器刷新按钮时,为什么Visual Studio不刷新文件夹?

时间:2022-01-22 21:04:04

In Visual Studio 2008, I can see all my project files in my Solution Explorer, and these files exist in an actual diectory.

在Visual Studio 2008中,我可以在解决方案资源管理器中看到所有项目文件,这些文件存在于实际的文件中。

However, if I add a file to that directory (let's say, an test.sqlite file in the App_Data folder, or say, images created by some other program), then these files do NOT appear in my Solution explorer, even if I click the refresh button.

但是,如果我将文件添加到该目录(比如说,App_Data文件夹中的test.sqlite文件,或者说是其他程序创建的图像),那么这些文件就不会出现在我的解决方案资源管理器中,即使我点击了刷新按钮。

How can I make files created by other applications appear in my Solution Explorer?

如何在其解决方案资源管理器中显示由其他应用程序创建的文件?

(so far, I have to create them somewhere else, then copy and paste them into the solution explorer itself, but there must be an easier way).

(到目前为止,我必须在其他地方创建它们,然后将它们复制并粘贴到解决方案资源管理器本身,但必须有一个更简单的方法)。


Edit:

Is there an advantage to this "fake solution view", i.e. I could have a file "test.sqlite" in my App_Data directory but in my solution, it could be appearing in my root directory. Coming from an Eclipse WYSIWYG Solution Explorer mindset, I don't see the advantage of having this extra virtual meta-information about the actual files in your directory. Is there a way you get an advantage out of this metaphor?

这个“假解决方案视图”是否有优势,即我的App_Data目录中可能有一个文件“test.sqlite”,但在我的解决方案中,它可能出现在我的根目录中。来自Eclipse WYSIWYG解决方案资源管理器的思维方式,我没有看到有关目录中实际文件的额外虚拟元信息的优势。有没有办法从这个比喻中获得优势?

3 个解决方案

#1


105  

At the top of the solution explorer is a toggle button "Show All Files" this makes it include all files in the display even if they aren't included in the project. The icons for these will be grayed out a bit. Then just use the context menu to add these to the project.

在解决方案资源管理器的顶部是一个切换按钮“显示所有文件”,这使得它包括显示中的所有文件,即使它们未包含在项目中。这些图标会稍微变灰。然后只需使用上下文菜单将这些添加到项目中。

#2


7  

On the solution, click the right mouse button and select 'Add existing item' and pick the file from the solution root directory. The Solution will now get a 'Solution Items' directory which contains your file. This directory is virtual, so it does not exist on disk.

在解决方案上,单击鼠标右键并选择“添加现有项目”,然后从解决方案根目录中选择该文件。解决方案现在将获得一个包含您的文件的“解决方案项目”目录。此目录是虚拟的,因此它不存在于磁盘上。

However there is no feature like 'Show All Files' for a solution, this only works on projects.

但是,没有像显示解决方案的“显示所有文件”这样的功能,这仅适用于项目。

#3


-1  

I faced the same issue. I added new files and folders but the next time I took latest source code from SVN and then opened the project, it wont show the files which were added.

我遇到了同样的问题。我添加了新的文件和文件夹,但下次我从SVN获取最新的源代码然后打开项目时,它不会显示添加的文件。

You can perform the following steps : 1. Solution explorer -> Show all files 2. Those files which are added recently will be displayed without the [@] icon on left side. Right click on the file and Select Include in the project 3. If you see the config file Web (Visual C# Project file (.csproj)) under Web folder, you will see the entries made for these new files. Check in this config file in your svn. 4. The next time you take repo checkout , it wont be an issue as the file details have been added into the configuration.

您可以执行以下步骤:1。解决方案资源管理器 - >显示所有文件2.最近添加的文件将显示在左侧没有[@]图标。右键单击文件并在项目中选择包含3.如果在Web文件夹下看到配置文件Web(Visual C#项目文件(.csproj)),您将看到为这些新文件创建的条目。在svn中签入此配置文件。 4.下次进行repo checkout时,由于文件详细信息已添加到配置中,因此不会出现问题。

Hope this helps.

希望这可以帮助。

#1


105  

At the top of the solution explorer is a toggle button "Show All Files" this makes it include all files in the display even if they aren't included in the project. The icons for these will be grayed out a bit. Then just use the context menu to add these to the project.

在解决方案资源管理器的顶部是一个切换按钮“显示所有文件”,这使得它包括显示中的所有文件,即使它们未包含在项目中。这些图标会稍微变灰。然后只需使用上下文菜单将这些添加到项目中。

#2


7  

On the solution, click the right mouse button and select 'Add existing item' and pick the file from the solution root directory. The Solution will now get a 'Solution Items' directory which contains your file. This directory is virtual, so it does not exist on disk.

在解决方案上,单击鼠标右键并选择“添加现有项目”,然后从解决方案根目录中选择该文件。解决方案现在将获得一个包含您的文件的“解决方案项目”目录。此目录是虚拟的,因此它不存在于磁盘上。

However there is no feature like 'Show All Files' for a solution, this only works on projects.

但是,没有像显示解决方案的“显示所有文件”这样的功能,这仅适用于项目。

#3


-1  

I faced the same issue. I added new files and folders but the next time I took latest source code from SVN and then opened the project, it wont show the files which were added.

我遇到了同样的问题。我添加了新的文件和文件夹,但下次我从SVN获取最新的源代码然后打开项目时,它不会显示添加的文件。

You can perform the following steps : 1. Solution explorer -> Show all files 2. Those files which are added recently will be displayed without the [@] icon on left side. Right click on the file and Select Include in the project 3. If you see the config file Web (Visual C# Project file (.csproj)) under Web folder, you will see the entries made for these new files. Check in this config file in your svn. 4. The next time you take repo checkout , it wont be an issue as the file details have been added into the configuration.

您可以执行以下步骤:1。解决方案资源管理器 - >显示所有文件2.最近添加的文件将显示在左侧没有[@]图标。右键单击文件并在项目中选择包含3.如果在Web文件夹下看到配置文件Web(Visual C#项目文件(.csproj)),您将看到为这些新文件创建的条目。在svn中签入此配置文件。 4.下次进行repo checkout时,由于文件详细信息已添加到配置中,因此不会出现问题。

Hope this helps.

希望这可以帮助。