Files show as hidden in Visual Studio 2012 - c#

Hei,
So we have a whole group of people working on the same project and every now and then some files show as hidden, you know the blank file icon like obj or bin.
See my font and texture? They should be normal.
So, I can see them in the folder but not in solution explorer without hitting the Show Hidden Files. I can also modify them but I would like them back.
I have been trying to see if there was a solution but all I get is blogs on how to show hidden files.
So I found this thread
Visual Studio 2012 and missing files
that seems to be giving the reason of my problem. People are not saving properly before pushing to github.
Now is there a solution to this?(apart from saving properly) Can I make all of those files become normal files?
Cheers

Simply right click the files/folders and include them to source control again.
This usually happens if people check in new files/folders but do NOT check in the updated project file, too. The project file contains a list of all files which should be included within the solution. If this runs out of sync, exactly this crap will happen... ;)
Simply instruct your folks to properly check-in. Or do code review on check-in and verify that the project/solution file(s) are also checked in.

They show up as hidden because they're not part of the project/solution, but they are on your file system.
You can right-click the files and click Include in Project
If this does not solve the issue after checking in. The project file is what is not properly getting checked in.

Probably the problem is that they are not pushing the project file (file with extension .csproj). It holds all references to files included on the project so it needs to be pushed when new files are added.
Let everyone know that they need to push this file in order to everyone to catch latest changes on project.

Related

Visual studio view (.cshtml) crashed and cannot recover

My view file(.cshtml) crashed and turned into as shown in image below. Actually, it happened right after the system was unexpectedly shut down. I tried other solutions like clearing temp files from bin. I tried to open it with notepad++ but it didn't work.
Any help will be appreciated.
Download WinHex program and open your corrupted file with it.
Go: Tools > Open Disk
Navigate to your corrupted file
Double click on it
If there is non-zero values, just copy and paste all this data to you new file.
I'm afraid you've lost it.
If you have a VCS in place (which you should), restore the file from there. Also, see if there are any previous versions of the file and try to fish it out from over there. Lastly, check your general-purpose backups, if you happen to have those.
If you have published your content, then in visual studio you can right click on the specific file and choose 'replace [fileName] from server'. This will download an uncorrupted version of your content from the published site.
Hope this helps.

What is the easiest way to make a backup in visual studio 2013?

I want to make a backup from the whole project. I also need to rename every backup. I'dont like the way to copy the project folder and rename the folder and the project file.
I've already tried to make it like that:
http://jasonfaulkner.com/VisualStudioExpressProjectBuildBackups.aspx
But it doesn't work, I am always getting the error "Invalid parameters"
Does anyone already tried this?
Thanks
The DPack extension for Visual Studio includes the Solution Backup tool that creates a zip archive of the solution and auto names it.
Manually edit .sln file
This method is entirely aimed at renaming the directory for the project, as viewed in Windows Explorer.
This method does not suffer from the problems in the Remove/add project file method below (references disappearing), but it can result in problems if your project is under source control (see notes below). This is why step 2 (backup) is so important.
1- Close Visual Studio.
2- Create a backup of your .sln file (you can always roll back).
3- Imagine you want to rename directory "Project1" to "Project2".
If not using source control, rename the folder from "Project1" to "Project2" using Windows Explorer.
4- If using source control, rename the folder from "Project1" to "Project2" using the functions supplied by source control. This preserves the history of the file. For example, with TortoiseSVN, right click on the file, select TortoiseSVN .. Rename.
5- In the .sln file, edit all instances of "Project1" to be "Project2", using a text editor like NotePad.
6- Restart Visual Studio, and everything will work as before, but with the project in a different directory.
Alse would recommend TFS, a powerfull tool to do what you pretend. You will be able even to recover previous versions of specific files,if you have any error and you have troubles find it you can see what changes you did since last "check in " etc. There are many options

InstallShield Without The Program Files Folder?

I feel like I must be missing something very basic. I have a legacy WinForms application with quite a few projects in it and I need to create an installer for it but I only have VS2012. So I installed InstallShield LE and researched how it all works and the output it gives me is a setup.exe file, setup.ini file, [appname].msi file, and 0x0490.ini file.
It then also has a folder called program files that has all of the files that I specified for a part of the installation and all of this is in the DISK1 folder. That's all fine and great but I've never seen a setup wizard that had a big folder of files sitting next to it, how do I just wrap everything up into one setup wizard without having to have the folder of goods in it?
Sounds like you're building a release with the compression turned off.
In the solution explorer tree, expand 'Prepare for Release' and select the 'Releases' node. Find the release you're using in the tree that appears on the left side of the window.
You should see a setting called 'Compression'. If it's set to 'Uncompressed', that's your problem. Change it to Compressed.

How to add a folder (with help) to resources and how to work with it

I am working on a basic calculator and I want to have a Help in it. I've already written it in XHTML. It is about 30 html files and over 30 jpg files (everything in a folder 'help').
Now a I would like to add this all into my Form. I don't know to add it to the Resources and how to open the 'index.html' file. I thing the System.Diagnostics.Process.Start(); is used for such things, but I've never worked with it. The activation event for this will be click on the 'ToolStripMenuItem'.
And my next question is: When I add all the files to the Project and publish the program (so it can be installed) would the System.Diagnostics.Process.Start(); work for every user? Because I don't know in which folder would the program be install.
Okay you are confusing a number of different things here.
If you want to distribute your help as separate files, you don't want resources.
Just add a folder called help to your solution/project in the solution explorer, move the files into it with windows explorer. Then right click on the folder, choose add existing items, select all your files. Then the important bit on each on them in the solution explorer, select properties , and make sure sure they are copy always, or copy if newer. . Now when you build your project, the help files will go with it, but not in a help folder!
Then you can launch index.html (in the same folder as your app) and the app (almost certainly a browser) associated will fire up with that file.
Resources, would mean the files were not separate, they would be compiled in with your assembly, and you'd have to extract them to launch externally or include your own help form with a be browser control. Have to be damn good reason to do all that work...
If you want one though. Right click on the project, select properties, select the resources tab.

Why does VS2010 allow for the concept of "include in project"?

I'm still learning the basics of how VS2010 sees the world. Apparently, you can optionally "include" a file in a project. I'm a bit confused by this: If a file is version-controlled, AND the file is within the project directory, shouldn't it implicitly be "included" in the project? If not, what's the use case where a version-controlled file in the project directory should NOT be included in the project?
=== Addition ===
Based on the answers I've gotten so far, maybe I should rephrased my question: What does it mean for a file to be "included" in a project?
A project needs to know about files in order for compilation and distribution to occur. Just because you have a file that's under source-control, doesn't mean that it will be compiled if the project is unaware of it.
Also, you may want to include files as part of a distribution package. We do this quite often for our web projects that we distribute using web app gallery.
Conversely, you could have documentation or sql scripts that you version control, but do not want them to be part of the project.
EDIT: In answer to your update, what it means for a file to be included in a project is that the file is actually added to the .csproj or .vbproj file and will be used during compilation and/or distribution. VS does differentiate if the file is Content or if it needs to Compile it. This can be seen by clicking on the file in Solution Explorer and looking at the Build Action property.
No, you don't want random files that happen to be in the project directory included in source control.
We do sometimes put documentation (pdfs) or drawings/schematics in the project folder and under version control but you don't need them inside the visual studio project (especially when they are not being distributed because they are for internal use only).
Excluding the file from your project can be useful if the file is related to the project but not necessarily needed in the solution.
Example
If I need some test XML for an application that i'm writing; that is designed to normally be pulling this from a WCF service, it can be useful to keep that file in the directory for a development environment where I use IO to get the XML for testing, but I don't necessarily want it in my solution which is source controlled.
When you exclude a file from a project is no longer compiled or embedded, then when you want to include it again you can do so without having lost your settings.
If you e.g. copy a file (containing a helpful class which want to have in your project) into a folder of your project, then you will see ... nothing. You have to check the option "Show all files" of the solution explorer and the copied file can be seen, but it is still "greyed out". No you can choose the menuitem Include in project and that file will be integrated in your project and a pending change (add) for your source control is added too. Visual Studio doesn't include all files it can find in the project folder automatically to the project - and that is a good feature.
One of my colleagues explained to me a scenario in which a version-controlled file should NOT be part of the project. Here's the idea:
A developer writes some new code.
The code is experimental, and not intended to be part of the normal build.
The easiest way to exclude the file from the build is to NOT include it in the project, but still version-control it.
This way, the file can be shared with other developers, but not break the build.

Categories

Resources