ASPX files sometimes readonly when debugging in Visual Studio 2010 Premium - visual-studio-2010

I'm running Visual Studio 2010 Premium on a Vista 32-bit machine and I've noticed that sometimes when I'm debugging a website project I can't edit an aspx file. If I close the file and open it again then I can edit it. Has anyone else encountered this problem? The only extensions I have installed are the VS Productivity Power Tools and Power Commands.

I also experience this problem (using Windows 7 or XP). This happens when:
I don't already have the .aspx file open in Visual Studio 2010
I am running the web app in debug mode
The file lock happens when I open and then try to edit an .aspx page (e.g. to tweak a bit of HTML) that I am currently viewing via a web browser when running the app in debug mode.
I've yet to find a solution for this problem however as a workaround I use "Browse With..." (Right click in Solution Explorer) to load and view the page(s) when I'm making HTML refinements. You can't debug code but it doesn't lock the files.

Related

VisualStudio not saving Startup Window

Since a few weeks I have had this infuriating problem.
Whenever I start VS it opens an empty environment.
I tried to change that in Options > Environment > Startup from "Empty environment" to "Start window". After pressing "OK" I restarted VS completely and reopened it. Again: a new empty environment opens.
After reinstalling VS several times now I gave up and want to know, if someone had a similar problem and knows a fix for this problem.
Visual Studio Enterprise 2019 (16.8.3)
Installed Workloads from VS-Installer:
ASP.NET and web development
Azure development
Python development
.NET desktop development
Desktop development with C++
Data storage and processing
.NET Core cross-platform development
Additional Extensions:
JetBrains ReSharper 2020.2.4
Visual Studio Tools for Tizen
*all the extensions are up-to-date
After MONTHS I finally found a solution. I basically tried to uninstall all extensions and discovered that this issue only occurs while ReSharper is installed. I didn't find anything regarding this on the internet, therefore I searched all of the options and I finally found the issue!
If you have the same issue and have ReSharper installed (currently 2020.3.3) open Visual Studio and go to Extensions/ReSharper/Options. A new window will pop up. Then navigate to Environment/Performance Guide and under the group Visual Studio preferences affecting performance you'll find the item Show empty environment at startup. Set it from Fix Silently to Ignore. Click Save and close this window.
Additionally, you have reset the specific Visual Studio option. Therefore open Tools/Options and navigate to Environment/Startup and set the On startup, open: to Start window. Click OK and restart Visual Studio to check if the Start Window now gets displayed correctly.

Console of Dev Tools in Excel for Windows 7

I have built an add-in which works fine in Excel online, whereas it does not work in Excel 2016 for Windows.
I know that in Windows 10, we could use this tool to debug the add-in, however I am using Windows 7.
I just installed Visual Studio 2017, right clicking on the add-in shows a menu where Attach Debugger is. But clicking on Attach Debugger fires nothing.
Does anyone know how to debug in this case?
Two potential options:
You can use Volorn.js to remotely debug your add-in. You can use the Debug Office Add-ins on iPad and Mac article as a starting point. Although this article is targeting Mac and iPad, the concepts are the same for Windows.
You can also use Visual Studio by creating a new Excel Web Add-in. Simply replace the default manifest with your own. Note that you still need to retain the default web site, Visual Studio still this for some library references. It will use your manifest's URL for the source location however.
Office applications use Internet Explorer for the web browser, so all settings from IE should carry over. I have found that if you disable (uncheck) both the Disable script debugging (Internet Explorer) and Disable script debugging (Other) options, your debugger breakpoints will be hit (I tested this in Outlook 2016).
You will need add debugger; statements to the source code to add breakpoints. When these statements are hit, a dialog like this should appear:
Simply select 'Yes' and a new instance of visual studio should open, with the debugger attached to your script.

How can I debug Silverlight 5 applications in Visual Studio 2012 after installing Internet Explorer 10?

I can no longer debug my Silverlight application in Visual Studio after updating to Internet Explorer 10. I made no other changes to my system and it was working fine with Internet Explorer 9 just before the update to IE10. When I hit F5 in Visual Studio, IE10 is fired up and the Silverlight application runs in the browser, but breakpoints are not hit in Silverlight code. If I hit shift+F5 (stop debugging), the browser remains open (this used to shut it down). Alternatively, if I close the browser while debugging, it doesn't stop debugging in Visual Studio (which it always did before). I'm running Win7 64.
This problem has also been reproduced in Visual Studio 2010 and Silverlight 4.
I had the same problem with Visual Studio 2012 and Silverlight 5. The symptoms that I was getting included the following.
Multiple browser instances would be opened when I started the application in debug mode within Visual Studio.
I sometimes got an error in the browser saying that the application could not be loaded.
Visual Studio would automatically detach from the browser and drop out of debug mode.
Turning off the Silverlight debugger (see the Web tab in the properties dialog for the web project) seemed to result in less of the other problems. This did however mean that I could not debug Silverlight code.
To resolve these issues, I right clicked on an aspx file in the solution explorer and selected 'Browse With...' to open the following dialog.
Note that there are two entries for 'Internet Explorer'.
I removed both (I set Firefox as the default temporarily to do so), cancelled out of the dialog and then reopened it. At this point, a new entry for 'Internet Explorer' had been added back in automatically. I made this the default and then had no further issues.
I had the same with VS2012..
Looks like Visual studio got confused which IE to use - somehow in system I hade two instances of IE as target browser (In VS2012 window called "Browse With..")
I removed all IE's from VS targets and restarted VS. Then only one instance of IE appeared after and debugger attaches normally.
I had a similar problem after opening a Silverlight-based application in two instances of IE10 at the same time. I could not debug. After which, I had switched between Chrome and IE10 in order to try and solve the problem. I could debug in Chrome but not IE10. But Chrome was cumbersome to run for debugging purposes.
Ultimately, I had to remove all the temporary files associated with VS builds in a three places:
C:\Users\brchase\AppData\Local
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
As well, I had to do a complete clean on the project and shut down IISExpress.
Also, I did a Tools /Delete Browsing History in IE10.
The above worked and I could debug again in IE10 -- even with multiple instances running.
Using Winserver 2008R2, VS2012 or VS2010. Latest version of FireFox does not hit SilverLight breakpoints. Tim Heurs solution at http://timheuer.com/blog/archive/2010/08/16/enable-silverlight-debugging-in-firefox-visual-studio.aspx does not apply as the required line is not in the FireFox config. My fix was to go back to IE9 (My IE10 was broken so I can't say for sure IE10 doesn't work)
Tried all of these suggestions.
Finally had to remove and re-install VS 2012 (which isn't straight forward anymore because after Oct 2013 some of the certificates had expired). Yay Microsoft!
So after re-installing I still had to go into the "Browse To" and switch it from IE to another choice then back to IE and it magically works now..
I think it was because Internet Explorer updated itself and left VS confused..

will visual studio 2010 support classic asp?

I'm using visual studio 2008 for a classic asp application. Will I be able to upgrade to visual studio 2010?
Yes, classic ASP can be developed just fine in VS2010 as it does in VS2008 SP1.
I've found this msdn page
http://msdn.microsoft.com/en-us/library/ms241740.aspx
it says:
Although the primary focus of Web debugging in Visual Studio 2010 is ASP.NET, you can also debug legacy ASP Web applications.
ASP Web applications consist of scripts, which run on the client in .htm files and on the server in .asp files; the Global.asa file; and .cdf files. Scripts can be in VBScript, JScript, or a mix of VBScript and JScript. They may also be mixed with HTML code and COM objects. You can debug ASP Web applications containing all of these elements.
Right now I'm working on classic asp pages with visual studio 2008 an everything works fine, I can even debug classic asp...
Still couldn't try it with vs 2010, but the page above gives me some hope...
Usually you can manually deploy an asp web site direclty to the inetpub\wwwroot folder (just paste all of your required web page files to the wwwroot directory), where your default.asp page should reside at the root of wwwroot, if that makes any sense.
Then you can create an empty web site with a single project, start your web site by entering http:\localhost in to a new browser window, and you should see your default page displayed.
You can add all of the extermely old asp files to your new fangeled visual studio 2010 application directly from the wwwroot directory.
You should be able to compile your application but you won't be able to debug it at this point.
To debug the ancient application, simply attach to the internet explorer process with the title of your outdated web application (or the wp3p process....), and you will then have debugging functionality.
Or, you can wait for the old yet useful app to throw an error and then use visual studio 2010 as the J.I.T.debugger.
Hope this helps as well.
Happy coding! (if that is possible in classic asp, thank GOD for visual studio)
(-:
To get VS2010 to support .inc files as well as .asp files, see the related question Can Visual Studio 2010 do ".inc" file syntax highlighting?
VS2010 syntax highlighting for .inc files isn't very good even with the Web Form Editor in use; the HTML shows up fine but the VBScript looks like plain text.
I updated my project from VS2008 to VS2010 and everything has been going alright.
In order to get debugging to work with javascript in a script block I have to add a debugger; statement to get it to break. If you have the javascript in a seperate file you can debug with just a break point. The Classic asp will still debug if I attach to the w3wp process.
The javascript intellisense has been working better for me in VS2010 than in VS2008. In VS2008 I had issues with it crashing when I stopped debugging classic ASP. In VS2010 I don't have that problem any more.
Overall I'd say VS2010 does classic ASP development better than VS2008.
For anyone who wants Syntax Highlighting in VS 2010 and can't get it working. I think this works.
Tools>Options>TextEditor>FileExtension
Add the extension ASP and it should be attached to "HTML Editor with Encoding".

Visual Studio 2005 - can not open form on designer

My team developed a GUI application on Visual Studio 2005, managed C++. Since some deliveries it is not possible to open the form in the designer, even if the source code and the project settings have not been changed. The designer reports this error:
Exception of type 'System.OutOfMemoryException' was thrown.
at Microsoft.VisualStudio.Design.VSDynamicTypeService.ShadowCopyAssembly(String fileName)
at Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(String codeBase)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
...
We successfully recompiled the project but we still encounter this problem.
Any idea?
This is how I used to debug these issues, Start a second instance of visual studio, load your project and attach to the first instance which also has the project loaded. Now set a breakpoint in the constructor and Page Load events and also any custom paint events that you may have in the form in the second instance and try to open the designer in the first instance, the breakpoints should get hit and you should be able to see what's going on.
I suspect that you have a Design Mode error where an infinite loop (or recursive control creation) occurs on the concerned Form.
One thing that helped me in these kinds of error on Windows Forms would be the following:
Open your Visual Studio 2005 solution for your GUI application. Don't open your form yet
Open another instance of Visual Studio 2005
In the second instance, Attach (Debug -> Attach to Process) the first instance of devenv.exe to the debugger. Make sure exceptions (Debug -> Exceptions) have all exceptions checkboxes under "Thrown" checked.
Now go to your first VS2005 instance and open the form. The second VS2005 instance will stop at the line where the error occurs.
This is a long shot, but try closing and opening the designer several times in a row. I have had the same kinds of problems with the C# Windows Forms designer (VS2005) : the form usually ended up opening correctly (after 5 tries, quite consistently).
I've run into the same issue intermittently when working with a large multi-project solution, or a project with an exceedingly large and complicated windows form.
I was able to solve the problem by enabling Visual Studio to use more than 2GB of memory. Here's the process...
(note: this assumes XP and Visual Studio 2005 - Vista and/or VS2008 will require slight changes)
Edit Boot.ini
Right-click My Computer, properties, Advanced tab. Under Startup and Recovery click Settings. Click the Edit button, and add the /3GB switch to the end of the [operating systems] line:
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /3GB
Make Visual Studio "Large Address Aware"
Run a Visual Studio Command Prompt, and change to the IDE directory:
cd %ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE
Use the microsoft tool editbin to modify devenv.exe:
editbin /LARGEADDRESSAWARE devenv.exe
Now reboot, and you're done!

Resources