Compressing(Zipping) VS2010 Solutions - issue when opening - visual-studio-2010

I need to compress a Visual Studio 2010 Solution into zipped folder, so I can transfer it over email.
I have done this before, but for some reason, when I just tried it, and tested reopening the zipped solution, I get the following
*C:\Users\Eric\AppData\Local\Temp\Temp3_WcfServiceConsole.zip\WcfServiceConsole\WcfServiceConsole\WcfServiceConsole.csproj:
error : Unable to read the project file 'WcfServiceConsole.csproj'.
C:\Users\Eric\AppData\Local\Temp\Temp3_WcfServiceConsole.zip\WcfServiceConsole\WcfServiceConsole\WcfServiceConsole.csproj:
The project file could not be loaded. Could not find a part of the path 'C:\Users\Eric\AppData\Local\Temp\Temp3_WcfServiceConsole.zip\WcfServiceConsole\WcfServiceConsole\WcfServiceConsole.csproj'.
I can't figure out why it would be doing this?
Is there another way I can zip up the solution correctly so that this doesn't happen?

It is pretty nice that Windows Explorer lets you look into a .zip file as though it is a directory. That's where the buck stops though, there is no .zip archive support built into Visual Studio.
You have to unzip the archive first.
To avoid a mistake like that in the future, switch Explorer to Programmer Mode. Start + Run, explorer.exe. Organize, Folder and Search options, View tab. Untick the "Hide extensions for known file types" checkbox.

You need to unzip the zip before trying to open it. It looks like you're just double-clicking the zip in Windows Explorer, then trying to open the solution file directly from the zip archive. That is, the path:
C:\Users\Eric\AppData\Local\Temp\Temp3_WcfServiceConsole_**.zip**\WcfServiceConsole\WcfServiceConsole\WcfServiceConsole.csproj
appears to be a path within a zip file. Visual Studio can't work with this until you unzip it.

Related

How to Run Program Downloaded From GitHub

I am new to running programs off GitHub.
I have downloaded Apriori Algorithm by Omar Gameel Salem from GitHub. I downloaded the .rar file and extracted it to a folder.
Can anyone can tell how to open the code in .NET and run it using Visual Studio 2008.
Extract the .rar to a folder
Open the folder
Look for a file with a .sln extension. (They are normally purple)
Open the .sln
Once Visual Studio loads the project, click Build -> Build Solution
After that, you should be good to go, just click the play button to run the program.

How do I install this Visual Studio project template?

I can't for the life of me figure this out. The "how to" video shows two .zip files in the ProjectTemplates/Visual C# folder, but I can't find them on this GitHub page... the instructions say under the "downloads tab up above ... download both of the project templates" and I can't even find the tab or the download option for the zip files seen in the video.
Here's what I've tried:
downloaded the single .zip file that contains both projects and put that .zip in the ProjectTemplates/Visual C# folder. Restart VS2010 - New Project, I don't see it as an option
Zipped the nested project, put that in the same folder as above. Restart VS2010 - New Project, but it's not an option
There is no .msi or .vsix file in the download.
Any help is appreciated
https://github.com/irobinson/WebFormsMvp-DNN-Module-Template
The downloads tab that the instructions refer to doesn't exist any longer, which probably explains why you're having trouble finding it.
Luckily, you can still find the downloads here: https://github.com/irobinson/WebFormsMvp-DNN-Module-Template/downloads
Once you've downloaded those and added the zips to your templates folder, you should be good to go.

How to add folders and move files into them in VS using AnkhSVN?

I tried accomplishing this using tortoise, but failed and reverted to my prior commit (How can I un-quagmirize my rearranged project?)
How can I add subfolders to my project and have them be recognized by Visual Studio AND Subversion?
Simply adding folders in Solution Explorer and dragging-and-dropping the files in Windows Explorer did not work.
It seems I can either add the files to the subfolders in Windows Explorer, but not have that rearrangement of file location recognized in Visual Studio's Solution Explorer, OR I can drag-and-drop the files within Visual Studio's Solution Explorer to the new subfolders, but that relocation is not recognized in Windows Explorer.
I HAVE re-added the subfolders within Visual Studio (I figure that can't break anything, while they are empty, anyway). Would right-clicking a file and selecting Refactor | Move be an accepted way to get this to work (I reckon the Refactor context menu item comes from Resharper, but possibly it's a VS "thing").
If at least one file is into a directory and this file was added via AnkhSVN (Subversion > Add), the directory will be automatically added as well.
If the directory is empty, even if the directory is included in the solution, the Add command via AnkhSVN will not work. This is a weird behaviour you can workaround using another SVN Client like TortoiseSVN.

Recover a .CS class file after crash

I was working on a class in visual studio 2010 when suddenly my computer crashes. after I restart the computer. I start Visual studio and I find that class to be completely empty.
it contained more than 1000 lines of codes before the class.
is there anyway i can recover that file?
Help please because I don't have another copy of it (Stupid of me)
If you cannot find the source code file, try using Reflector to decompile the most recently built dll you have containing that class. It won't give you your complete source, but at least will give you something to start with.
Note: Reflector is no longer free; if that matters, try dotPeek from JetBrains instead.
Also, look into using a source code control system. This will let you 'commit' versions of your code to a repository, so you'll have a copy in case something like this happens in the future.
Subversion, Git, and Mercurial are popular ones; In my opinion, Subversion would be the easiest to start out with, especially with TortoiseSVN (OS integration) and AnkhSVN (Visual Studio integration). If you don't want to worry about setting up a repository/server, look into a hosted solution, like Beanstalk, which offers Subversion and Git and lets you try it out with a free, limited account.
Good luck - I hope you are able to recover your source!
Something which worked for me was back-up.
BTW I was trying to recover a VS2013 file on a Windows 8 machine.
Try to check in below location in your system.
C:\Users\username\My Documents\Visual Studio \Backup Files\ProjectFolder
I found an original file with original-date.filename.cs name and a recovered-date.filename.cs files.
The original was the one needed.
Deleted the one in project, added the original file and renamed it to file.cs. Tried building and debugging and it gave the expected results.
Also just want to add one more thing...
In my case i had an aspx page with its respective .cs and designer.cs
The .cs file got corrupted and I did build on project, with the designer.cs the project got build successfully and the dll got replaced. And when i tried to recover using reflector everything was in a state no return. :(
So don't build the project if you see any file got corrupted.
in visual studio 2019 I find the file in a files with TMP extension
FileName.cs~xxxxxxxx.TMP
This happened to me a few times as well when Visual Studio was crashed or System was shutdown unexpectedly.You can recover these corrupted file using Recuva. It dose not recover the file every time but in most of the cases it's work perfectly.
Below are the settings which you need to configure before recovery.
Start Recuva. Enter Advanced mode if the Wizard launches.
Click Options.
In the Options dialog box, click the Actions tab.
Click Scan for non-deleted files, and then click OK.
Run the Recuva scan as normal. Non-deleted files are indicated with a green double-circle status icon.
Hopefully, you will find your corrupted file in recovered files as it recover multiple versions for that file.
Very useful question. I got issue of file crash on sudden shutdown of my PC. recovered file using "Recuva"(download link: https://filehippo.com/download_recuva/) software. Scan for non-deleted files was helpful.
I got help from: https://www.samnoble.co.uk/2014/11/30/visual-studio-crashes-and-a-corrupted-cs-file/
Well, that happen recently for me and I did get my file back this way.
1. Find the project DLLs in the bin folder. Example MySolution.dll
2. Download and Install .Net Reflector from https://www.red-gate.com/products/dotnet-development/reflector/trial/thank-you
3. Open the .Net Reflector app and click the open folder icon then move to your bin directory and select MySolution.dll file
4. Then traverse and expand through your namespaces and classes to look into your codes.
5. Have fun!

Visual Studio Cannot Open File

I'm working on my first project in Visual Studio and I haven't used Windows much since '05, so please bear with me.
I've got my project open in Visual Studio 2008, and I'm trying to open a particular file for editing, but I get an error that says
"c:\path\to\file
Cannot open file.
I've verified that the file exists, and I can open it from Windows Explorer, but nothing from inside Visual Studio, any ideas?
I'm not familiar with Visual Studio, so my terminology might be incorrect.
The file appears in the tree in the Visual Studio Explorer pane, so I double clicked it, and got the error. The error said nothing more than the file path: Cannot open file.
How can I check permissions/ACLs in Windows? I assumed that since I could open it in Windows Explorer, I would be able to open it in Visual Studio.
And it's a .cpp file.
You may want to right-click on the file in the tree, and delete it from the project.
Then, add back an existing item.
Hopefully that will fix the problem.
Though I'm not familiar with this specifically, if you just want to move forward, I'd recommend creating a new project type and just adding all the existing files to it. Should be quicker and easier than diagnosing what could be many issues.
Other things to check: encoding type of the project file, permissions/ACLs (can you open that actual file from an unelevated VS prompt, for instance), etc.
Additionnaly to the other answers, I found out that this problem may arrise if the target .Net framework version specified in the project file isn't installed.
This seems to prevent visual studio from opening all the files contained in the project, and showing the "Unable to open file " message.
Correcting the version (in the csproj file or in the settings), saving and reloading the project fixes the problem.
I had same problem, my project were build on (.Net 4.5), which I uninstalled on my PC and replaced by (.Net 4.8), so just replacing project's target framework to the one which is installed "in my case (.Net 4.8)" should fix it.

Resources