VS 2012 RTM Intellisense Broken - asp.net

This seems to be happening on a project-by-project basis. Currently I am working on an ASP.NET 4.5 Web Application Project. Intellisense was fine one day but not the next. I am using a custom project template but that should make no difference. I tried editing the text editor settings so that Auto list members and Parameter information are both checked. I tried to reset your Visual Studio settings (Tools --> Import and export settings --> Reset all settings) and I also tried the solution in the accepted answer here:
Intellisense not working
Has anyone got any insight or suggestions? Pending any answers, I've submitted a Connect bug report: https://connect.microsoft.com/VisualStudio/feedback/details/766891/intellisense-broken-in-vs-2012-rtm

You may be able to refresh Intellisense cache with Ctrl + Shift + R (on standard shortcut keys)
I've had the same issue on VS2010 and fixed it another method described at How to turn IntelliSense on in Visual Studio 2010?
From the link:
Delete the files in this folder: %AppData%\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas (the 10.0 folder may be a different number for VS2012)
If nothing else works, you type this in the Visual Studio Command Prompt (this is in your Start menu) and hit enter: devenv /resetuserdata
This last option is documented here on MSDN, with the following disclaimer:
Disclaimer: you will lose all your environment settings and
customizations if you use this switch. It is for this reason that this
switch is not officially supported and Microsoft does not advertise
this switch to the public (you won't see this switch if you type
devenv.exe /? in the command prompt). You should only use this switch
as the last resort if you are experiencing an environment problem, and
make sure you back up your environment settings by exporting them
before using this switch.

Related

Cannot Git Diff CSHTML Files in Visual Studio 2015

I am using Visual Studio 2015 with ASP .Net MVC 6 on Windows 10. As far as I can tell everything's up to date, but I haven't changed anything recently that I know of. In the last couple of days Visual Studio has stopped letting me compare the current version of an *.cshtml file to see what changes I've made. It works for every other type of file I've tried, only these ones are being a problem.
I am getting the error message "Failed to start the configured compare tool." I've seen a couple of other posts (like this one: Visual Studio 2015 using Git unable to compare files and Microsoft Git Provider and Visual Studio 2012 failed to start the configured compare tool) but they seem to be talking about a more general cannot diff at all problem, which isn't what I'm seeing. It's almost as if git (or VS?) has decided to pick just this one file type to not like.
I have tried creating a new ASP .Net project with a new git repository and it sees the same problem, and the problem goes away if I rename the .cshtml file to give it a different extension. I've had a look in the .gitattributes file but can't see anything, though if I'm honest I don't really understand how git works beyond the basic 'this is how you drive it around when it works'. I've also tried removing and reinstalling everything git related I can find on my PC with no joy.
Anyone have any ideas on what I could have broken?
Update: I've just found this https://github.com/aspnet/Tooling/issues/293 which suggests that it might be related to an ASP .Net Update. Guess I'll probably have to wait and see.
Clearing the MEF cache appears to resolve this also. Close the IDE and delete the contents of this directory:
%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Clear MEF Component Cache (Open VSIX Gallery) will probably do the trick as well.
Likely related to https://stackoverflow.com/a/32376450/1154135
This turned out to be related to a problem with the new ASP .Net tooling. They've apparently got a fix to be rolled out, but until then there is a workaround:
In the options panel, go to Options->Text Editor->HTML->Advanced
Set Identity Helpful Extensions to False
This is as per https://github.com/aspnet/Tooling/issues/293#issuecomment-161382206
Check your .gitignore file for references to .cshtml files. Dollars to doughnuts that something like *.cshtml is in that specific repo. Can you run the diff in git outside VS?

VS 2013 ASP.NET can't modify the code while debugging

I'm working with a ASP.NET 2.0 project that has been upgraded from vs 2005->2010->2013.
In vs 2005 and 2010 I can modify the code while debugging, save the changes, and reload the page with the changes applied.
Now in vs 2013 I can't do this. Can't change the code when I hit a breakpoint. Tried to activate all checkboxs in "Edit & Continue" options, but nothing worked.
It's annoying having to stop debugging and recompile the app to debug again the changes.
How can I solve this?
FINALLY figured it out. Here are my findings.
To Reproduce:
I created 2 vanilla projects:
1) .net 4.0 project with VS2012 (ProjectA)
2) .net 4.5 project with VS2013 (ProjectB).
Then opened ProjectA with VS2013 and I couldn't Edit & Continue (E&C).
Resolution:
In VS2013, go into the project's properties on the "Build" tab and uncheck "Optimize Code".
I still don't know why I could Edit & Continue in VS2012 even with "Optimize Code" checked, but in VS2013, it won't work.
Resources:
Here is the link that aided me in locating the problem:
http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(vs.debug.ENC.SupportedButNotAvaiable);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.0);k(DevLang-csharp)&rd=true
Hope this helps!
I know this is a bit old, but I found the answer today - at least one answer. I'm running Visual Studio 2013 Update 1 and in my case, attempting to debug an MVC 5 application. Switch your target platform (in the Build menu) from Any CPU to either x64 for 64-bit or x86 for 32-bit.
I ran into this today while attempting to debug my MVC 5 application. After reading the release notes for Visual Studio 2013, including the fact that they added the ability in, I was puzzled. I checked my properties and saw that Optimize Code was unchecked while Edit & Continue were checked. The only other debugger marked was ASP.NET. On a hunch, I changed from targeting Any CPU to just targeting x64 under the Build menu. After that, I was able to use Edit and Continue as long as I wasn't attempting to edit lambdas or other items!
Find little solution for this case - close all files in solution before run debug.
Only files which were closed when debug is started can be edit.
Of file is opened when debug is start - edit is not possible.
What works for me, is the following:
1) Break point is hit, and I want to change code.
2) Now: Set next statement to somewhere earlier in the current function.
3) Do the change
4) Save / CTRL-s
5) Stepping through the function now includes the change.

Visual Studio 2010SP1 locks up when typing class=" in MVC3 project using razor

Sometimes, not always, Visual Studio locks up when typing class=" on any element. This doesn't happen all the time and I can't seem to identify a pattern other than VS has usually been running for a while.
Also, I have ELMAH installed and set to email me on exceptions. Relatively often, although not always I get an email when typing class=" like below. Why would it be trying to start the project when typing class?
System.Web.HttpException: The controller for path
'/Views/TechSupport/#Url.Content(' was not found
or does not implement IController.
To resolve the issue I restart Visual Studio. Sometimes the problem persists and I need to restart it again. Usually it works properly at that point, without the above ELMAH email. If not then I reboot.
This is my only MVC project, so I don't know if it's specific to this project or not. It did seem to happen very early on in the development process though. This only happens when I type class=", nothing else triggers a crash/lockup.
EDIT - ADDITIONAL INFO:
For some reason, when I just typed class=" an error dialog box popped with the message
Cannot load "c:\Progra~1\MICROS~2.0\Common7\Packages\vwd\mso.dll"
When I click OK I get a second dialog box that says
Visual Studio has encountered an exception. This may be caused by an extension.
It then goes on to suggest I use the /log parameter when start VS, which I will be trying now.
I was having the same issue and found that by going to the Extension Manager -> Online Gallery and search install the Web Standards Update for Microsoft Visual Studio 2010 sp1 Fixes it.
You may have to uninstall it and re-install it if it's already installed.
Update
Here is some other info that may help:
http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/c249aa35-ed66-431a-9cc3-03b0b84f5f21/
http://social.msdn.microsoft.com/Forums/en/csharpide/thread/ac74d91c-b76d-49a3-b599-a8f19df9303a
http://connect.microsoft.com/VisualStudio/feedback/details/727091/visual-studio-crashes-when-editing-an-mvc-4-beta-cshtml
Open Options->Text Editor->CSS->Miscellaneous and disable "Statement Completion"
Also in the General section there are other "Statement Completion" options.
Try closing the project, deleting the contents of the "bin" folder inside the Project folder (you might backup your project before), then re-open the project.
As a last resort you can try creating a new project and re-importing the project & code files, or even repairing/re-installing VS.
Try "Enable Insert attibute value quotes when typing" on Tool -> Options -> TextEditor -> HTML -> Formatting

Website running .NET 3.5 cannot use feature not part of ISO-2 specs

I am getting this error a lot:
Feature '{insert feature here}' cannot be used because it is not part of the
ISO-2 C# language specification
I am working on a .NET 3.5 website that I've worked on on and off for about two years. I've never seen this error before my most recent around of updates. I'm using a decent amount of LINQ coding throughout and I get these errors related to much of the LINQ code. Based on what I've read it seems like even though I'm using .NET 3.5, for some reason it thinks I'm using 2.0. But I can't find anything that says how to fix it.
One example of a problem is that if I try to add a new item to the App_Code directory, I do not get the option to add a LINQ to SQL dbml file.
If anyone can shed some light on how exactly I would fix this, I would much appreciate it.
I was unable to locate an "Advanced" option under the build tab. I have a feeling it is probably because it is a web app. I looked through the web.config and found 2 parts that may be important. Most things referenced 3.5.0.0 or v3.5. The settings are consistent with older backups of the web.config from when there were no errors. By the way, only intellisense and things within VS2010 are giving me problems. The website is running error free.
I have completed a total uninstall and re-install of VS2010 and I'm still having the same issue. I fired up my old install of VS2008 and I am NOT having this issue there. However, I would MUCH prefer to use VS2010 on this project.
I opened the website in VS2010 on my work computer, and there are no errors reported. This is making me think that there is something on my laptop that is causing the problem. As I noted above, I completely reinstalled Visual Studio 2010 and I am still having the problem. What does this leave? I have only one extension installed in VS, and it's the same one at work and on my laptop. Also, I did not reinstall the extension after reinstalling VS, and the problem persists.
Both PC's run Win7 Ultimate. Have VS2008 and VS2010 installed. VS2010 has the same extension installed on both. On my laptop I have the full version of SQL Server 2008 installed, but only the Management Studio on my desktop (we have a server in the office). Would SS2008 have anything to do with it?
Go to your project properties, the Build tab, Advanced - that should allow you to set which version of C# you want to use. It should default to the latest version supported by the version of Visual Studio you're using, but it sounds like at some point you've switched it to ISO-2.
(That's certainly true for Windows projects and class libraries - there may be a different location in a web app. In particular, have a look in Web.config.)
If this has only started happening recently, I'd have a look through your source control history at changes to any configuration files. Also try creating a new project of the same type, and see if that has the same problem.
Jon Skeet's answer is mostly correct. The location for the update is in the "Property Pages" which I got to by right-clicking on the name of the website, clicking Property Pages, the Build item, then target framework.
The extension I use, Solution Navigator, has it's own heading for the solution. Right-clicking on it DOES NOT give me the Property Pages option. By chance I right clicked on the title of the website under the solution heading and was presented with the Property Pages option. In there was the Build tab which contained the target framework option.
Once I finally found the target framework option, it was indeed set to .NET 2.0 for some reason. I changed it to 3.5, reloaded the solution, and now it works great.
Thanks a million Jon for your help and time working with me!!

vs2005 - Switching between design and source mode get stuck

I dont know if anyone else has had this problem. I'm using VS2005 working on a C# website.
The problem is on the .aspx page, when I click on the "Design" option two things happen.
It does not switch to design mode. I see only source. But I the problem is that the source mode gets stuck and uneditable.
Second thing is that I cannot switch back to source mode and hence am stuck only in that non-editable mode.
I tried to Reset my settings, but that hasnt helped.
Any ideas?
Try running visual studio in safemode. Launches Visual Studio in safe mode, loading only the default environment and services, and shipped versions of third party packages.
Try the below command in Start-> Run
devenv.exe /safemode
http://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.80).aspx

Resources