Visual Studio 2012 Web Publish keeps overwriting existing files with same version - visual-studio-2012

Just installed VS2012 and run across a strange behavior by the one click publish feature.
I'm publishing via FTP and everything works fine except it seems that VS insists on overwriting some files over and over even though nothing's changed.
In VS2010 clicking the "publish" button over and over just runs through the steps and finishes in a few seconds, in VS2012 it takes about two minutes as it keeps copying a 5mb dll and some other stuff too.
P.S the "delete all existing files prior to publish" is off

It's an absolute pain. I've resorted to keeping the solution open in VS2010 alongside the VS2012 and using VS2010 to publish, it's annoying, but it's faster...

Unfortunately there's no option for only changed files in VS 2012. Not sure why they took it out, other than maybe too many people complained that VS wasn't synching properly when their FTP servers were the problem. FTP servers are notorious for not giving back correct file info.

This is real too slow on large amount of files.
My best experience is to remove unused folders not containing assemblies (scripts, css, etc...) this way <ExcludeFoldersFromDeployment>Content;Scripts;Views</ExcludeFoldersFromDeployment>
.
Publish these files straight when you change them . Otherwise publish assemblies from profile .
https://msdn.microsoft.com/en-us/library/ee942158.aspx#can_i_exclude_specific_files_or_folders_from_deployment

Related

Conversion to x64 platform in visual studio failing

So I built a huge website for my company using the AnyCpu option. I didn't think it would matter - I have a 64bit machine with x64 windows, it's getting deployed to a x64 server, and there's no attached dll's, so it should just all be in 64, right?
Well, in the process of trying to implement some security, the company's support told us the application MUST be strictly x64. I figured it was, but to humor them, I went into the configuration manager, and changed all the target cpu, platform etc settings to x64.
Unfortunately now, it breaks when I hit f5 to run it. I've run into this before, I think, and I vaguely remember needing to delete some temp internet files somewhere, but I tried closing VS, deleting the bin folder, deleting the root folder from /framework/tempASPfiles... but I still get the BadImageFormatException - "an attempt was made to load the program with an incorrect format."
What's the best and fastest way to convert an app to x64? and am I right in thinking I need to delete some files somewhere?

Visual Studio incredibly slow when renaming files

I have a medium-sized solution with 99 projects that has recently started behaving weirdly:
1) If I try to rename a file through the solution explorer, VS will seemingly hang, but after a long time (10+ minutes) it will complete the rename operation.
2) I also noticed today that switching to between Debug and Release mode seems to freeze VS as well. So far I haven't let it run long enough to see if that actually completes.
I've tried both Visual Studio 2012 and 2013, and both exhibit the same problem, so that seems to indicate the problem might not be with Visual Studio. I've tried to check in the event log if there's anything there, but nothing jumped out on me. I've also rebooted and run checkdisk, but it didn't find anything wrong.
Running Windows 7 Professional on a fairly high-specced laptop with 8GB RAM and a new SSD
Update: apparently if I have renamed a file once, I can keep renaming it (and other files in the solution) immediately. When I restart VS, it's slow again.
Update2: I left the computer running overnight to try to switch from Debug to Release, and it managed to do so in the 14ish hours between me leaving work and getting back here.
Visual Studio can be extremely slow in renaming files if you are using TFS with a "local" workspace as oppose to a "server" workspace, and the total number of files including different versions in the TFS repository exceeds 10,000 items.
Contrary to Microsoft's recommendation, I suggest using a server workspace instead of a local one for much better performance. There are also some other downsides to local workspaces and the only upside is being able to work while your TFS repository is down. That's not much of an upside considering if you can't connect to TFS, you probably can't connect to your LAN and there's darn little work you can do anyway in that situation.
To change to a server workspace for TFS in Visual Studio 2015,
In VS click on File --> Source Control --> Advanced --> Workspaces
In the dialog that opens, select your workspace and click Edit...
Click Advanced... (it does not matter which mapping is selected).
Under Location, select Server and then press OK.
Switching over to server may take ten minutes or more depending on the size of your repository.
Once this is done, renaming files should be nearly instantaneous.
When testing I'd made an attempt at setting up one of the projects to build on a different server, both in Debug and Release mode. I though I'd cleaned up both, but apparently I'd only done so under the Debug configuration.
Apparently meanwhile that server has decided it hates my machine, which makes my machine freeze while waiting for it.
Closing Visual Studio and manually editing the .csproj file solved the problem.
Unfortunately 99 projects is not a medium sized solution for Visual Studio but instead a very large solution. Visual Studio simply doesn't scale well to solutions of this size and you're seeing the effects of that here.
The only way to make this better is to factor out your solution into several smaller solutions.
Building on #Daniel Barbalace's answer, my issue indeed had to do with TFS, but I could not switch to server workspaces. What I ended up doing was removing the mappings to any branches or projects that I am not working on at the moment. There is no magic number but once I seemed to get under 50,000 files (globally for the TFS folder) renaming suddenly went down from 2+ minutes to 3-5 seconds.
In my case "git" cause that,i have a bunch of html files in my commics project,so,when i removed .git folder i have again fast renaming files.
I had the same issue. Renaming one file would take a decade. I found a solution however. When I first check out for edit, renaming becomes very fast again.

TFS 2012 is not recognizing a file as having been deleted

I am working with another developer on an applciation. Whenever one of us deletes a file that has been pulled down on the other workstation. TFS doesn't seem to pass down the files as deleted on the next get request.
Short story: I delete file -> Check in -> Team mate does get -> gets build errors due to the files still being on his local disk
Anyone know what we are doing wrong?
We are using local workspaces. We are checking in the delete. Everything we are doing is happening in Visual Studio. Not in a file explorer anywhere.
UPDATE: It has something to do with resharper 8 and TFS not playing well together. When I move a file or safe delete a file with resharper commands TFS doesn't recognize it (the green lock sign is not in solution explorer).
I suggest you to check in your csproj file, he contains all files included in your project, your another developper get latest old csproj, so you find your file

Why won't my VS2012 recognize modified files on disk and reload?

I've been away from Windows and Visual Studio for a few years. Now I have VS2012, and I notice that it fails to recognize that a file has changed on disk (i.e. by a different editor). In fact, even if I hit the refresh button on the Solution Explorer window, it still doesn't reload the file. I can close the window and reopen it -- still no luck. I thought "gosh, I hope I don't have to close and reopen the solution each time!", but it turns out even THAT doesn't do the trick.
Its as if VS is caching old copies of files and cannot imagine that someone might use something other than VS to modify them.
These are just local files, no network issues involved. I must be missing an understanding of some major new "feature", yes?
--- Edit: -----
Ok, here's some progress. I've been using the VsVim extension to have a vim-compatible keymap. On a hunch, I disabled it, restarted VS, and found the problem solved. Then, I re-enabled it, and the problem is still solved. So the mystery remains, but not the problem.
I don't have VS2012 (I went up to 2005), but from what I remember, this is configurable from the IDE. In VS2005 go to the menu, choose Tools, then Options, then Documents, then you'll see the options to detect when files are changed externally, and to auto-load files changed externally. I think in VS2012 it'll be similar.

Visual Studio 2012-Update 2 Won't Load Solution if SUO File is Present

I develop in VS 2012/.NET on several computers (all running Windows 8 Pro x64). Although VS is installed on all computers I keep the project folder on an external USB3 drive. Every once in a while I would find the project files had been corrupted on the USB drive (e.g. cross-linked). Fortunately I keep frequent backups but clearly this situation is intolerable, so I set out trying to find what the issue(s) might be.
I still don't have a clear answer but one piece of strange behavior is this: if I open the .SLN file for my project in VS 2012 when an .SUO file is NOT present it loads fine, builds are OK, etc. HOWEVER, if I then save the project, exit VS (so an SUO file is created) and then attempt to REOPEN the solution VS hangs at (....loading). I get the usual "Visual Studio is busy....." messages and there is no point in waiting, the solution just never loads. I have to kill VS in TM. I've tested this repeatedly, and I've even done it from the local hard disk (as opposed to the USB drive) to see if USB was the problem. It isn't. Remember, this is all on the same computer (so as to remove "moving" as the cause of the issue). The only way I can work with the project is to delete the SUO file before trying to open it.
I would assume, if this was a VS bug, it would be pretty much all over the web and my searches would have turned up something. So I'm asking if anyone has any idea what the problem might be or if there are links that might help me figure things out.
Thanks in advance.

Resources