Visual Studio 2010 randomly expands collapsed sections - asp.net

My question is simply, is there a hotfix that will repair the bug which randomly expands collapsed sections in an aspx page after a few seconds. Once I re-collapse them it no longer collapses them, until I close the page and reopen it.
I'm running VS2010 vanilla (no service pack).
Thanks.

ctrl+m, ctrl+s just collapse the current region. in java script you can use this extension and tools. but I think you need to a custom command, take a look at this:
How to add commands to Visual Studio 2012?
and for more information about more shortcuts in visual studio, check out this answer:
Visual Studio, Collapse/Extends Regions ONLY shortcut

Related

Visual Studio 2010 issue properties not updating when clicking on a control (gridview)

My hard drive died recently so I had to install visual studio 2010 all over again. With this version of VS anytime I click on a control (like text box or gridview) the properties section doesn't update. Even when i right click on the control and click view properties it doesn't update ... The only way i can get the properties tab to update is by building the project (but i have to do this every time i want to view properties of a control). I have uninstalled and reinstalled (VS 2010 and SP1) but neither have had an effect on the issue.
I have also tried turning off the add-ons as i thought this might affect performance (but not joy). I also have Visual Studio 2008 and this works perfectly.
Its like as if the application isn't refreshing or something ? And the build is forcing a refresh ?
Well turns out it was McAfee Virus Scanner !!!!!!!
So annoying, i turned On-Access Virus Scanning OFF and everything worked :-)
Unfortunately the On-Access Virus Scanning turns itself back on after a few hours so I have added Visual Studio and my files location to the exclusion list and this works !
Hopefully someone else will find this useful

Can I use Sublime to edit CSS files within a Visual Studio 2010 project

Is there a way to automatically launch Sublime from within Visual Studio 2010, for example, every time I click open a CSS file? I need all the source control functionality to remain intact - I just want to change which editor gets used for a few filetypes within VS / TFS projects. Is this possible?
Right click the file, select "open with...", add sublime as an editor, click set default.
You'll probably need to right click checkout/checkin manually in visual studio still. This functionality is a lot nicer in tfs2012/vs2012 when using local workspaces as files are no longer marked as readonly.

Is it possible to change icons in Visual Studio 2012?

Is there any way to replace VS2012 solution explorer's icons with VS2010 ones? At least 'folder' icon :(
Here is a shot of my VS2012 install that almost looks like the familiar 2010 we are all used to. It makes me feel normal again!
Here is exactly how I did this, step-by-step:
1) Close all instances of Visual Studio
2) Download vsip and extract it to a temp directory. (as of 1/3/2013 the current version is 1.5.2)
3) Open up a command prompt with "Run as administrator"
4) Go to the temp directory and run VSIP.exe - This will run an interactive program that accepts commands.
4a) Type "backup --version=2012" - This will backup all of your VS2012 UI dlls, just in case something gets messed up and you want to uninstall VSIP.
4b) Type "extract" - This will extract all of the old icons from your installation of VS2010 (per VS2010 license VSIP can not distribute those icons so we have to have a local install to pull them from).
4c) Type "inject" - This will inject all of the old 2010 icons from the previous step into the VS2012 DLLs.
4d) Type "menus -n" - This will change the menus so they are NOT ALL CAPITALIZED!
5) Download and install NiceVS - do not download the one dated 10/14 or you will be missing icons. As of 1/3/2013 I downloaded the file named "NiceVS.0.8.1.1 Beta.Full.vsix".
6) Download and install VS2012 Color Theme Editor - The next time you start VS2012 select the "Blue" theme from the color select window.
Now you should have a nice install of VS2012 that looks like my screen shot above! It takes three different applications to patch that hideous UI but it's certainly workable now! If you don't have VS2010 installed on the same machine as VS2012 then you will have to run step 4b on a machine with VS2010 and then copy the VSIP Images directory to your 2012 development machine.
Update: If you install "VS 2012 Update 1" after running these steps you will need to re-run step 4c from the VSIP admin prompt (or all of step 4 if you didn't keep the extract of the VS2010 images). The file menu icons and color scheme stay as they are but the update reverts the icons in the solution explorer back to the ugly ones. Re-running the VSIP inject fixes it right up!
Short Answer:
Hack the old icons into 2012.
Visual Studio Icon Patcher - http://vsip.codeplex.com
Long Answer:
Doing this with a plugin, for now, is out of the question. I've been unable to find any built-in way to achieve this and the switch to WPF makes it even harder to hack around.
This app simply extracts the image resources from the unmanaged DLLs in Visual Studio 2010 and injects them into the DLLs for Visual Studio 2012. The managed resources are a lot more complex and haven't been added in yet, though I have gotten some to work.
The initial release didn't work well with themes that had a dark Tree View background color due to how the icon colors are inverted when a dark background color is detected. This is made even worse in the newest release since menu & toolbar icons are included now. I'm running this with the Blue Theme and it looks fine.
One way to hack around the icon inversion is to edit all the extracted images to add a single cyan pixel in the top right corner of each icon in the image map. This will exclude them from the inversion process. I haven't tried this though because I ran into issues early on when manipulating the images where they wouldn't display right. You could try it but it'll be fairly manual and time consuming and may not even work.
Look at this thread:
Solution Explorer - custom icons for my folders
I think it's also applicable for vs2012
If not -> you can manually find solution explorer's icon resources with ResHack (or Resource Hacker) and simply replace it!
Here is the solution:
Visual Studio Icon Patcher http://vsip.codeplex.com/
Description from VSIP web page:
Project Description Visual Studio Icon Patcher allows you to update
Visual Studio 2012 with the icons from Visual Studio 2010.
Until someone can find a way to change the icons via a plug-in the
only way to change them is through resource patching the DLLs that
Visual Studio uses. There are a number of managed and unmanaged DLLs
containing Bitmaps and PNGs that are used to style the application.
For now only the unmanaged DLLs are part of this process with the
managed DLLs hopefully coming soon.
No images are distributed with this project. You will need to have
both Visual Studio 2010 and 2012 installed to use this.
Update
I've just tested VSIP with Visual Studio 2012 Update 2, and it work flawlessly :-)

Visual Studio 2010 Toolbox controls disabled

VS 2010 Toolbox in ASP.NET application development (design mode or source) is not showing all controls (showing HTML and reporting ones), I can see all by right click (Show all) but they are greyed out or inactive.
I have used devnev.exe in VS Command line to reset, have reinstalled VS, have deleted the four hidden files in C:\Users\Ramzan\AppData\Local\Microsoft\VisualStudio\10.0 with extension .tbd, all in vain.
This thing is driving me mad. I have another machine and everything works fine there.
Any help much appreciated.
Don't know if this applies; but I had all controls in the toolbox disabled; you could see them but they were disabled - This in Visual Studio 2010. I right click on a toolbox item then reset toolbox and then they are enabled. Note that you may lose any custom controls you added.
Probably your project is RUNNING. STOP the project then your toolbar items will become enable.
Right click in toolbox and remove check from "SHOW ALL" (if checked)
This was driving me crazy for a pair of days. In the choose items menu my 3rd party controls (CrystalReportsViewer) were checked. Reset toolbox did nothing to enable them. My solution was changing the target framework from .NET Framework 4 Client Profile to the full version .NET Framework 4, seems the client profile which is a subset of the version optimized for client applications does not support my controls or just using references to other 3rd party .dll librarys. This issue should only be for .NET 3.5 and 4.0, Client Profile is discontinued for .NET 4.5
I had the same problem and fixed it now after 3 days:
reset toolbox (not worked)
close and reopen the solution (not worked)
close and reopen the VS (it worked!)
After a long time googling , and mostly all answers - revolving around
Reset Toolbar
Delete .tbd files from C:\Users(your user)\AppData\Local\Microsoft\VisualStudio\11.0
Using devenv.exe /SafeMode & devenv.exe /ResetSettings.
None of them working out for me, making me more sick.
There is something I did which worked and thought it's worth sharing if it helps someone.
I followed all of the above steps, failing . I did Step 1 & 2 with my project (in VS 2012) open and
Right Click on Toolbox > Choose Items > Pressed Reset > ok.
Then again, Right Click on Toolbox > Add Tab > 'gave it some name' > then again
Reset Toolbox
There was some screen flash/flickering - some loading .
And to my surprise the Grey life ( grey controls ) were now available .
Hope this helps someone like me! :)
This worked for me..
How to completely reset the Toolbox and enable Visual Studio to rebuild it from scratch
Close Visual Studio;
Open the "c:\Users\\AppData\Local\Microsoft\VisualStudio\10.0" (Windows 7) folder and remove all the .TBD files;
Run the "regedit" tool. For this click the "Run" item in the Start menu and type "regedit" without quotation marks;
Find the "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\ToolboxControlsInstaller_AssemblyFoldersExCache" and "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\ToolboxControlsInstallerCache" keys;
Remove everything from these keys leaving them empty;
Run Visual Studio again and wait until it recreates all items in the Toolbox.
If you are working in WPF application and your Xaml is opened with xml, then make sure you right click and view designer, to get your toolbox controls enabled. (Toolbox controls seem to be active(enabled) only in designer mode). At least that was the case with me.
I know this is old but I just encountered the same problem and here is what I did:
Click on Data Flow
Right click anywhere in that window
Select SSIS Toolbox.
Hope this would help someone.
I worked for me doing the following steps:
Reset Toolbox (Right click in Toolbox->Reset Toolbox)
Add a new tab with any name (Right click in Toolbox->Add Tab)
Reset Toolbox (Right click in Toolbox->Reset Toolbox)
What helped me was changing Project type from Windows Application to Class Library - then (after re-build and reopen...) I got all Controls Enabled.
What did it for me on a custom control was to first remove the control from my base project. Then I had to pull up the custom control as a separate solution by itself and recompile it. I had to make sure that that it was compiled as a class library and not as a windows application. I had to make sure that it was compiled with Framework 4 (same as my base solution) and that all sub controls and projects were also using framework 4. Once I got all of those things sorted out I went back to my base project and added the newly compiled control and sure enough it was enabled.
I hope this helps someone.
I tried all the above mentioned still not working for me. I was working on a windows application after that I have started the web application coding on visual studio after that whenever I was opening the Visual studio this problem was occurring. I am using Visual studio 2015. So what I did, I have right-click inside the toolbox panel and selected 'choose option' then under '.Net framework' components tab I have checked all check boxes for which assembly name is 'System.windows.forms' It is working for me now.
Make sure the currently opened solution platform actually supports controls you need.
My problem was, for example, that I tried to add 'SqlConnection' control to .NET 6.0 application.
Once, I created a '.NET Framework Windows Form' project 'SqlConnection' control became available

Visual Studio 2008 IDE freezes/crashes when opening .aspx file with css included [duplicate]

This question already has answers here:
Visual Studio 2008 hangs while opening aspx/ascx file
(10 answers)
Closed 7 years ago.
Visual Studio (SP1) runs fine until I try and view .aspx source files with the lines
<style type="text/css">
</stlye>
anywhere in them, upon which it freezes (i.e is totally unresponsive) and I have to use the task manager to shut it down.
I have read a lot of questions about Visual Studio 2008 crashing on viewing some source files. However, I still can't fix this problem.
I have systematically deleted and re-included all other code and it comes down to these two lines, which is very confusing. Sometimes it happens as soon as the lines are added, sometimes it doesn't freeze until I build the solution with any of the problem pages open. I can add external style sheets, and it only started recently.
I had Resharper 4.5 installed and have since uninstalled it, and do not have anything else installed.
Also, it happens to other people with the same source code, and re-installing Visual Studio does not fix the problem. So I have several questions:
Is there any way I can find out what's happening?
I don't understand how the code (the css tag itself) could crash Visual Studio, and am thinking that this is unlikely and it must be something else within my solution, would this be a safe assumption?
Could this have anything to do with installing Office 2010?
Thanks in advance to anyone who has ideas on how to troubleshoot this problem.
Edit:
I didn't find a good answer for this question, but found that installing Visual Studio 2010 and using it instead of Visual Studio 2008 fixed the problem. I have marked the answer below as right as it gave me an idea on where to start looking.
So from this I am going to conclude that this is some sort of Visual Studio bug, but would be happy to see more information if any one else encounters this problem or can shed any light on it!
The above should work - I actually used the solution here - repair office 2010 web authoring components - http://www.ariankulp.com/archive/2010/03/02/web-form-designer-lockup-in-visual-studio-2008.aspx
MSDN Code Gallery shows 45 items tagged Visual Studio 2008 and hotfix. it's very hard to search for your problem with keywords, but browsing through the 45 might help.
I just ran into a similar problem (VS2008 freezing every time I tried to open the Manage Styles / Apply Styles / CSS Properties windows).
What fixed it for me was:
Uninstall Microsoft Visual Studio
Web Authoring Component
Reinstall
Microsoft Visual Studio Web
Authoring Component from the VS DVD
(just run
WCU\WebDesignerCore\WebDesignerCore.Exe; it doesn't have a UI, so you just have to wait for it to finish).

Resources