Visual Studio 2013 Update 2 - code files corrupt randomly - visual-studio

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.

Related

Blank Security Warning when Opening Website in Visual Studio 2015

I get a blank security warning popup window when trying to open a website, in Visual Studio 2015 Community Edition. It worked on my other computer in the same environment.
I moves the files to a new fresh computer and I get this window.
Here's a screenshot:
Nothing is clickable, even what where the buttons should be. Visual Studio is just frozen, can't even close the IDE nor the popup window. It doesn't happen to Web Projects, only websites.
Any idea how to solve this?
I got the same issue. Just fixed it. In my case it was entity ".tt" files fault. I guess for some reason VS 2015 does not recognize ".tt" extension. I've just deleted these files and run website (not web application) successfully
The .tt files are needed if using Entity Framework.
Here is my workaround that worked in two cases of the blank security warning. Rename the files with .tt extension to .tt.old.
Open the project (it will not compile, so don't try)
Save and close the project
Rename the .tt.old files back to their original names
Open the project again, this time the warning will have content and will be clickable.

Visual Studio extensions keep disappearing

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.

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.

Removing SourceSafe Integration from Visual Studio 6

Recently, the SourceSafe integration into visual studio has started to perform badly because we have moved, and the SourceSafe "server" is located across a VPN which goes across a slow connection. This has made loading large projects in visual c++ 6 take 5+ minutes because it has to talk to the "server" for each project. Also, there are some bugs that are dangerous in the integration (the auto-checkout of certain shared projects will do a get latest on the wrong version of a branched file). This has caused me to want to disable the SourceSafe integration, however I have not found any menu option or uninstall option. Google has reported a few registry tweaks, but none of them seemed to work.
Does anyone know of an easy way to remove the SourceSafe integration from Visual C++ 6, without uninstalling SourceSafe altogether?
From http://support.microsoft.com/kb/236399:
Source code control software, such as
Microsoft Visual SourceSafe, that
integrates with the Visual C++
integrated development environment
(IDE) can be configured to connect to
a source code server during Visual C++
startup. In such cases, a loss in
network connectivity will cause Visual
C++ to start up very slowly. To
improve performance, either ensure
proper network connectivity or disable
the source code control software
integration with the Visual C++ IDE.
To do the latter, quit Visual C++, and
then use RegEdit.Exe to locate the
following registry key and set its
Disabled value to (DWORD) 0x00000001:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Source Control\Disabled
I followed this and it seemed to work upon trying it again. I think I might've had a second copy of visual studio running when I did it the first time.
Open the .dsp and .dsw file in a text editor, and remove the respective entries from the .dsp and the .dsw file. Also, delete the .scc files.
There is a Microsoft Knowledge Base article about how to do exactly this.
The gist of it is that you must manually edit the .dsw and .dsp files in a text editor, and remove a few other files lying around. See the article for more details.
If the solutions mentioned above fail for you do this:
Rename folder: \Program Files\Microsoft\%vs%\Common7\IDE\VS SCC
VS will complain once about plug in not being there and you say "Yes" to ignore it in perpetuity.
All files “got latest,” “read only,” and edited in VS, will make VS complain and offer to “override”, which works fine for me.
What do you gain:
Open VSS-linked solutions quickly without VS matching contents to VSS server.
Open VSS-linked solutions and EDIT the files at will without being bogged down in “check out” bs.
This makes using other distributed source control system on top of project tree with VSS bindings painless.
VSS client still works by itself just fine, including diff, checkout, checkin.
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Source Control\Disabled
I followed this and it seemed to work upon trying it again. I think I might've had a second copy of visual studio running when I did it the first time.
Its working .....Thanks Ajay
What has worked for us, and is much easier, requires no registry/file editing by hand, and safer I think is this:
1) Exit Visual Studio completely.
2) Disconnect from the network (unplug the cable and turn off wireless, or disable the network adapters)
3) Open the VS6 workspace (DSW) for the project. When it starts up it will find it cannot connect with the VSS database it wants to and ask you about that...
4) Tell VS to never try to reconnect to the source control db in the future.
5) Done... VS does all the changes to THAT WORKSPACE/PROJECT setup for you. You are not disconnecting VS from source control in general (like a registry edit would do) and your not manually editing files.

Resources