简体   繁体   中英

Show all files by default for VB.Net in Visual Studio 2013

I would like to know, in Visual Studio 2013 , how to modify the default VB WindowsForms template to always show all the files (the referenced assemblies).

For VS2010 exists a question and a solution here: Show All Files by default

However, I've reproduced the steps of that trick, but it doesn't work for Visual Studio 2013 .

The older trick consists in add the windowsapplication.vbproj.user (with the ShowAllFiles attribute set) in the template folder, and then, adding this entry into the windowsapplication.vstemplate file:

  <TemplateContent>
    <Project File="WindowsApplication.vbproj" ReplaceParameters="true">
      ...
      <ProjectItem ReplaceParameters="true"  TargetFileName="$safeprojectname$.vbproj.user">windowsapplication.vbproj.user</ProjectItem>
      ...
    </Project>
  </TemplateContent>

However, when creating a new project, the windowsapplication.vbproj.user is not copied to the desired destination.

By my own I noticed that seems an additional entry is required in the windowsapplication.vbproj file to tell the IDE that should not ignore/miss the windowsapplication.vbproj.user file, so, just I tried to see what happens adding this:

  <ItemGroup>
    ...
    <None Include="$safeprojectname$.vbproj.user">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>windowsapplication.vbproj.user</LastGenOutput>
    </None>
    ...
  </ItemGroup>

With this new modification now the file is copied, however, is not properly copied, seems that the file is just included in the solution explorer as part of the project, and nothing more, because I still need to press the Show All Files button to show the "hidden" references. But ...at least doing this, if I close and reopen the project, like the file was copied, the changes take effect at this point, but of course is a weird behavior the need to close/open the project once to see the Show All Files button properly pressed...

No, this hack doesn't work anymore. It documents the wrong directory, it should be ProjectTemplatesCache, but that doesn't otherwise fix anything. The file does get copied but then it immediately gets overwritten, the VB project system now always creates a projectname.vbproj.user file for a new project. An empty one. Used to work in older versions because it did not yet do that, creating the .user file only when needed.

This otherwise has a very easy fix, you just need to wait another 3 weeks. VS2015 always shows the References node for VB.NET project. A design change that was inspired by the added support for Live Code Analyzers, a Roslyn feature. The References node shows which analyzers are enabled for a project.

Use Project > Properties > References until you update.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM