Opening vbproj and sln files leads to visual studio open - vb.net

I searched about vjproj and sln files in general on this website.
I understand why they exist.
However, my question is, when I open those files in sublime text, I see the xml or something else clearly (or anything they are supposed to show). But when I double click them, they just lead to usual visual studio environment. And I don't understand why executing those two files make visual studio open even though they are supposed to be markup languages?
Thank you!

OS only care about the file's extension to pick which application responsible for handling that file. In most case, .vbproj and .sln are associated with Visual Studio application no matter the file's content. To test this behavior, try to rename the file's extension to .xml and it will be treated as XML file.

Related

Can I override the OutputPath of a project on the solution level from within the VS2015 IDE?

My goal is to override the OutputPath property on all projects in a solution to be $(SolutionDir)$(Configuration)\. I would like to set this from within the VS2015 IDE.
I don't want to change the OutputPath in the .csproj or .vcxproj files (I know how to do this and it's not my intention to make a permanent change to the project files). I just need a local change for the moment to build.
I know I can accomplish this from the command line in a Developer Command Prompt by setting /p:OutputPath=$(SolutionDir)$(Configuration)\ on msbuild. Ideally, would like to be able to do this from within the IDE. Is that possible?
I was able to set OutputPath in a Developer Command Prompt and then launch VS2015, open the solution, and build:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"
Typical way of doing this is to import the same msbuild file in each project, and set OutputPath in that imported file. Disadvantage: project files need to be modified, it's not 'from within VS'. Advantage: has to be done once only, works on commandline as well as in VS, works for everybody, is pretty flexible and extensible. For example you could override OuputPath based on whether or not a certain file is present on the system, or a certain environment variable, or hostname, etc.
The answer you gave also works, though is also not from within VS. But the biggest drawback for me is that if you give your project to someone else they won't have an overriden output path, i.e. such modifications cannot really be put in version control. Of course if that's what you are after than it's fine.

Visual Studios 2010 Shared Project?

I have been searching around for an answer to this question, but I cannot find the documentation on it. I found a few similar questions asked here, but none that completely cover it?
Similar Question
What do all of the different files in the project directory do? I am trying to make my project open source and I don't want to have a ton of unnecessary files in my repository. What files are vital and what files will be generated when the user initially loads the project? Its important to note that this is a VB Form Application
Base Directory:
*.vb
*.Designer.vb
*.resx
*.vbproj
*.sln
*.vbproj.user
*.config
Any of the other folders in the base directory?
*/bin
*/Collection
*/My Project
*/obj
*/Resources
*.suo and *.user files can be ignored. They store user specific settings such as window arrangements, open files etc. Those files are generated by Visual Studio whenever a solution is opened.
*.vb files are somewhat important since they contain your source code...
*.sln and *.vbproj files tell Visual Studio which projects are in a solution and which files are in a project, respectively. They also contain project specific settings such as build plattforms, custom build events, target .NET Framework etc.
*.resx and app.config can be important, depending on your project. They should not be left out when you publish your project, however since they're part of the Visual Studio project. If they're truly not needed you can remove them from the project.
Edit
Folders bin and obj are where Visual Studio generates the compiled output so you should not include those when you publish the source code of your project. Any other folders are project specific so it depends on your project if they're needed or not.
As a rule of thumb, anything that is automatically generated should be excluded when you publish your source code.
Also, if you don't already, you should use a version control system such as Subversion or GIT to manage your sources. Any essential files / folders as explained above should go in there.

Visual Studio Solution

My program adds files to a VB.NET solution. What I want is that the project, when files are added to it, is refreshes or prompted to refresh. Now what I am currently doing is unloading and reloading the project. This is fine, but I noticed that my newly added files are not included in the project, and I have to manually include them by clicking them.
How can I make my project add all files that are not included and refresh when new ones are added?
Thanks
My code to add.
A lot of files can exist in folders and subfolders under the solution (sln file). not all of these files are required to participate in projects. each project file (vbproj / csproj) maintains the inventory of files included in the project. you need to both place your files at appropriate places and update the vbproj file appropriately.
As it happens, the vbproj files are not simple indexes, they are full blown build scripts. they have a pretty intricate file format (XML) and a convoluted semantics. Appending nodes in that file works fine if you follow the existing pattern. but i suggest you look up MSBUILD first.
Please note that if the project you are mutating programmatically, is open in visual studio, then there are strong chances of inconsistency. make sure the project is not open in any visual studio. programmatically altering the program itself (or the same project) is not advisable.

Team Foundation Server - Committed files appear hidden for other TFS-Members

Since some months, we are using TFS 2012 with Visual Studio 2012 and until some weeks we didn't notice any problems during checking in/out. Furthermore, we are working on a ASP.NET MVC4 project.
But recently, we noticed that if Person A checks in new files (f.i. .cs or .cshtml) and Person B does "Get latest version", then he receives those files but they are hidden for some reason. So we have to do "Include in project" manually every time. This happens to any of us.
Neither I have direct access to the TFS configuration nor did I change my Visual Studio settings. Thus, it is really strange that this happens for no known reason.
Do you have any ideas what I should try or check?
The only time I have seen this kind of behavior is when someone checks in the files, but not the corresponding .csproj file. The .csproj file contains the definition of what files are included, so for the solution to build with the new files, the .csproj file must be checked in as well.
Note that it may be necessary on occasion to do a "Save All" before the changes to the .csproj file are committed.
I would recommend checking the .csproj file of the last few check-ins that have had this problem. I've encountered this any number of times when one of my co-workers "Excludes this file" from the project because they don't understand why something isn't working. They forget to re-include it in the project and then check everything back in. The project file doesn't contain the files that were excluded.

Include an XML file in the Project Build

I have written a small VB.NET simulation program that uses an XML file to configure the simulation. I want to include this file in the project build so that when the application is installed, there will be a default XML file in the required directory.
When I do the Project Publish (within VB 2010 Express), there is no option for including any extra data files in the process.
Is it possible to do this with VB 2010 Express ... or should I try some other project builder/installer.
Any pointers will be very much appreciated,
Regards,
Oliver
The option isn’t found in the publisher, it’s a property of the file itself: when you add a file to the project you can set its file properties in the property window (usually at the right-hand side of the screen, below the file browser).
There you can set its “Build Action” to “Content” and its “Copy to Output Directory” mode to “Copy if newer”.