Visual Studio extensions keep disappearing - visual-studio-2010

I am by no means a visual studio expert. However I have done some searching on this topic and cannot find anything to help me.
I'm working on a VS 2010 web application. We are using TFS 2012 for source control. I wouldn't be suprised if this is causing my issue so I make a special mention of it.
The issue I'm having is every morning after I open the project I have to go into Tools / Extension Manager and search online and add JScript Editor Extensions. When I open the project the next day it's gone and I have to add it again. (I think sometimes it does this right in the middle of coding - my Javascript window changes size and loses formatting)
An extension that stays every day regardless is NuGet package manager, so it's not removing every extension.
I suspect that when I get latest from TFS it's overwriting the solution or project which contains the reference to the extension but I haven't been able to verify this.
Can anyone tell me why extensions would be removed? Are these a local user setting or are they contained in the project file?
Taking a step back, my real problem is complete lack of integration between C# and Javascript in the web programming world. I need all the help I can get on the Javascript side.

There were a number of issues with buggy extension addins. To clarify are you using visual studio 2010 with tfs 2012 plugin?
The recommended process for identifying the buggy extension is to disable the extensions one at a time until the buggy one is isolated.
the source control shell for tfs2012 can be installed as a separate shell if needed.
I suspect the script editor extensions however.

Related

How to collapse solution explorer view of razor pages?

I was coding with razorpages when randomly about 2 days ago the razor pages now display boths the cshtml and cs right away. earlier I could expand the cshtml to get to the cs file and i think it was a more compact that way
i think its options somewhere in tools->options->environment () but there are so many
after a few different google searches I found nothing helpful.
here is a picture of the problem:
earlier I could expand the cshtml to show the .cs files now i just see all of them and its kind of overwhelming.
enable file nesting in solution explorer
They're not being nested, is all. It's literally two separate files, Visual Studio just recognizes that it's a Core project, and then shows them nested, since it understands that they're related. If that's not happening, then that means Visual Studio doesn't recognize it as a Razor Page, which could be a problem with VS, the project, or something else entirely. It's essentially impossible to say what the issue might be, so you'll just need to try stuff. A few things I can think of to try:
If you're not using VS 2019, upgrade. Ultimately, this is part of the ASP.NET Core tooling, and best version of that is always going to be in the latest release.
Verify that you solution is building correctly. You might also consider deleting all bin and obj directories and rebuilding to ensure the build is truly up to date.
Close Visual Studio completely and re-open it. You may consider restarting as well. (You've probably already tried this though).
Try running Visual Studio in "safe-mode", which essentially just means disabling all the extensions you have installed. You can either manually disable all your extensions and then restart or close Visual Studio and start it via the command like with devenv /safemode. If this fixes the issue, then there's an extension causing issues. You'll probably need to just disable each one by one to see which on is causing the problem, and then either remove it or see if there's an update that corrects it.
If all else fails, repair Visual Studio. Run the intaller, and click the "More" link under the installation you're working with. Then click "Repair".

Visual Studio 2013 Update 2 - code files corrupt randomly

This has been happening to me and others on my team, maybe once a week. We'll be debugging a web application project and then edit and save a text file that is part of the site (like a .aspx or .css files). The file will initially be fine in visual studio and look normal, but the output to the browser will be garbage. It's hard to know what's going on until you close the file in visual studio and try to re-open it. Visual studio will open the file in notepad for some reason, and you'll see all garbage characters.
To fix the problem I have to revert the file from TFS and any work not in TFS is lost.
We have Resharper 8.2.1 and the latest Telerik UI for Asp.net Ajax controls installed. Everything else is pretty standard setup for Visual Studio.
The web application project is set to use IIS Express.
Does anyone else ever have this problem, and know what might be causing it?
Edit: This just happened again, but this time with a class library project. So it doesn't seem to be exclusively a problem with web application projects.
In my case the problem had to do with the encryption software that is installed on my Dell laptop - "CREDANT Mobile Guardian Shield". If you have administrative access to this, then you can add exceptions so that it doesn't encrypt your project / solutions folders.
I don't have access to modify the exception list, so what I did was look through the exception list and found a path listed that looked suitable for placing files I work with. In my case I chose "C:\sources\". I reinstalled all of my tooling into c:\sources\apps\, and use c:\sources\projects\ for all my solution files / TFS workspaces. My apps run faster now because there's no encryption overhead, and I haven't had the file corruption problem since doing this about 2 months ago.
Notepad is believing that the text file is Unicode but it is ANSI. Change the file encoding to Unicode.

Visual Studio 2013 breaking Web Site

I have a really weird problem, be interested in some pointers
We have a website that we have coded from Visual Studio 2003 -> Visual Studio 2010. We are now looking at moving to 2013.
The website is in IIS, when I navigate to it using IE it works. When VS2013 is -open-, not running, but has the project open we get a weird effect where the contents of the website gets duplicated by 3, its as if there are 3 iframes on the page, all with a copy of the same web site.
I close VS2013 and it goes back to normal
So, just to be clear, we don't even have to run the web site from within VS2013, just the project being open is enough to cause the weird effect
We use subversion as as far as I can tell no files have been modified when VS2013 is open
Any suggestions?
Thanks
It's Browser Link that's doing it! If you switch off Browser Link it works.
The source shows some extra script entries before the final tag but other than that the whole source is duplicated.
We don't need Browser Link and I don't have reflection capabilities on Asp.Net source so as to why that's for some one else to determine, I noticed a few people complaining when I searched on it so it may be something that just gets fixed in a future version

Is there a simple way to check out files in TFS from a Mac environment running Sublime 2?

Ok, before I explain in detail, here's my (very odd) setup:
Hardware: iMac
OS: Mountain Lion
Software:
Editor (Mac): Sublime 2
Virtualization: Parallels Running Windows Server 2008
IDE (Windows): Visual Studio 2010
Source Control (Windows): Team Foundation Server
So here's my dilemma.
I looooove Sublime 2. However, being a Microsoft shop at my workplace, I have no choice but to deal with TFS. I don't do a lot of back-end coding, I'm a front-end guy and don't need all the hefty class and structure tracking built into Visual Studio, so Sublime is perfect for me.
One of the things I love about Sublime is that I can hit cmd+p and pull up any file immediately. The alternative is spending several minutes sifting through our file structure to locate the same file (we have a massive project structure...it's a beast).
Unfortunately, I can't just tap cmd+p and pull up any file...I can...but after editing it, I hit save and "uh oh! file isn't checked out, it's read only". I then have to switch spaces, spend several minutes sifting through directories to locate that same file I worked on, and check it out. Switch back, save, and then check it in. It wastes a lot of my time and defeats the time-saving benefits of Sublime's file searching.
What I'd like to know is if there's an easier way to accomplish this. I've tried a few things and none have panned out. I found a plugin that integrates TFS with Sublime - but that only works for Windows. I tried using Eclipse with a TFS plugin, but I still have to browse through a massive directory structure to check out the file in Eclipse before editing it in Sublime.
Is there any way to streamline this process better? I know it might sound silly to go through such extremes to save a minute or two here & there, but when I do this hundreds of times a day, it starts to save a LOT of time!
Thanks in advance to the community for any help on this!
If you can persuade your TFS Admin team to upgrade to TFS 2012 you will have your solution. TFS 2012 supports "Local Workspace" which does not keep files read-only on disk. You download your source code once through Visual Studio or Eclipse and keep working in ANY editor you want. TFS Client tracks changes on the file system and you just need VS or Eclipse to check-in your work at the end of the day.
For TFS 2008 and 2010 you have to check-out your files manually or with the help of a supported IDE. Those versions only support "server workspace"s and that flavour of workspace keeps all files on disk as read-only.
You might have another chance with 2008 or 2010 tough. TFS 2008 and TFS 2010 on Windows platform supports offline working, which temporarily disconnects your workspace from the server to do your work. Then at the end of the day you go back online and TFS client tries to "detect" what changes were made when you were offline and lets you check them in. This blog post says Team Explorer Everywhere supports offline work. You might need to remove read-only flags of files manually. Offline working is not perfect even on Windows platform and you need to be careful until you get used to it but I believe it is worth giving a shot.
If upgrading to TFS 2012 is an option then you probably want to consider it.
TFS2012 with local workspaces no longer require files to be checked out in visual studio first (files are no longer marked as readonly, and vs detects changes from other programs). This will get rid of one of your alt-tabs to windows.
You'd still have to alt-tab back to check in, you could potentially use a commandline "tf checkin" if you don't want to keep visual studio open.
So after trying several suggestions from here, among a few I found elsewhere, I've come to the conclusion that the best setup (for me) is as follows:
Editor (Mac): Sublime 2
Editor (PC): Sublime 2 with TFS plugin
Virtualization: Parallels Running Windows Server 2008
IDE (Windows): Visual Studio 2010 Source Control
(Windows): Team Foundation Server
So as you can see I updated my existing setup with one slight tweak. On my Windows side, I installed Sublime 2 and installed the TFS plugin. If I want to check out a file, I switch to windows, search for the file, check it out via Sublime's TFS plugin, then switch back to the Mac. It's certainly not ideal, and requires an extra step, but it seems to work the best for me and is faster than using Visual Studio to check in/out.
If anyone comes up with a more elegant setup (aside from using TFS 2012 - which thankfully is coming for my organization), I'd love to hear about it. In the meantime, I hope this helps anyone else who might be using a setup similar to mine.

Getting Visual Studio to ignore source control bindings in a solution

Is there a way to tell Visual Studio 2005 to just ignore source control binding when opening a solution? I sometimes need to load a solution for which I don't have access to the source control server, but Visual Studio insists on trying to connect anyway, meaning I have to click "temporarily work offline in disconnected mode" for every project in the solution (of which there are about 20) as it loads. For some reason, it also tries to check each project out immediately after I've told it to work offline, so I have to click past that dialog box too.
As I will never need to edit anything in this solution, is there any way I can open it and have Visual Studio just ignore the fact it has source control bindings in it?
Edit: Ideally, I'd like a way to do this without having to change the project/solution files. They change fairly frequently, so I'd have to redo any changes every time there was a new version (otherwise I'd just unbind them once and it wouldn't be a problem).
Thanks for the replies so far.
The source control bindings are stored in Visual Studio solution file (.sln). For TFS for example, it contains a global section for TFS information and the solution projects added to TFS. You can edit the solution file to remove these bindings manually. I would suggest making a copy of the solution file first. However, I would recommend removing bindins via Visual Studio. Open your solution and go through the offline scenario. Then go to File/Source Control/Change Source Control (VS 2008) to bring up the UI that shows you the source control bindings in your solution. There you can manage the bindings including unbinding them. Once unbound, the next time you open the solution, VS should not have a need to access the source control.
I've been looking for a way to disable Integration between SourceSafe 2005 and Visual Studio 2008. We are forced to use SourceSafe being in a corporate environment and all. SourceSafe is fine on its own if you treat it like a baby. As soon as you try to do anything approaching useful it starts to break. God forbid you try to use the integration with Visual Studio. Being that I didn't want the "Bindings removed" so that it doesn't confuse other devs on the team I needed to be able to tell Studio to ignore the solution and project bindings and continue on it's merry way.
I followed the registry hack suggested in the following post
Removing SourceSafe Integration from Visual Studio 6
Studio did what I wanted...sort of. It removed the SourceSafe integration. However when I opened up a source controlled solution it asked me if I wanted to remove the bindings.
"the projects will be treated as not under source control"
No I don't want you to remove the bindings from the files, I want you to IGNORE them. This dialog pops up every time you open the solution/project file and there is no way around it.
My solution at the moment seems to have worked...for now.
File->Source Control->Change Source Control...->Disconnect
I hope this helps anyone else in the position of having to use SourceSafe but can't remove the bindings from the files themselves. WHY, Microsoft, WHY would you put the bindings in the files themselves?
/rant

Resources