Unable to automatically step into the server - debugging

I need to debug WPF Client with RIA Services. In VS 2010 it was working fine and now I am under VS 2012 and I an facing this error.
Any clue how to return to debugging?
I have already checked web.config and it has <compilation debug="true" targetFramework="4.0" />

Did you try right click on devenv.exe and select Troubleshoot compatibility? And always execute VS with administrator permission.

Related

Can't start/debug application in VS2013 anymore

Since today I can't debug any applications anymore.
If I want to start the debug session, I get the error message
error while trying to run application: invalid pointer
It doesn't depends on the project, this behaviour appears in every project/solution.
What i've already tried:
Reset VS settings
repair Visual Studio
complete reinstall of visual studio
Changed Build Platform to x86/x64
Enabled native code debugging
If you press Ctrl-F5 to run the application, you won't get the error and the application will start, but you can't do debug, so this isn't a real solution.
The only way to solve the problem is to update Visual Studio: I had the same problem (WPF application), which was solved by the Microsoft Visual Studio 2013 Update 4.
If you're running VS 2013 and get an error that's pointing to the body tag, try adding this to the web.config under
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
That key disables browser link which currently isn't playing nice.

Visual Studio 2013 IntelliSense stops working for ASP.NET MVC5 Controllers

I am facing a weird problem in my Visual Studio 2013 ASP.NET MVC 5 project. All of a sudden, the IntelliSense in the Controller classes of the MVC 5 project are not working at all.
I have other class library projects in my solution and IntelliSense is working in those class library project files, but the problem is only within the MVC project. Usually these kinds of problems are solved by restarting Visual Studio: not only did I restart Visual Studio, but I also restarted my computer, and the IntelliSense problem is not getting fixed at all.
Are there any other steps that can get me IntelliSense back?
Close Visual Studio. Delete the <ProjectName>.v12.suo file. Reopen solution.
Resetting my settings or importing previously exported, working settings, and restarting Visual Studio worked: Tools > Import and Export Settings... > Reset all settings.
EDIT: This keeps happening to me, surprisingly often in VS Express, and occasionally in VS Professional. One thing I noticed in Pro, is that it has happened after unexpected shut downs (when IT forces a reboot in the middle of the night). So it may be related to Visual Studio not closing correctly. The technique described above has worked every time.
Tools > Options > Text Editor > C# > General
Make sure that "Auto List Members" is checked
I have found one way to solve the problem. That is,
1. -> Remove the ASP.NET MVC Project from Solution,
2. -> Then, add the MVC Project back to the Solution.
By doing these steps, I can get the Intellisense again. But, I am not happy with this solution though, because, next time when I double click the Solution file to open the solution, I see the intellisense is not working again. I would like to know the real reason why it is behaving like that.
EDIT:
Finally, I figured out that it was a 3rd party visual studio extension which was causing the problem. In order to find out that extension, I removed all extensions and then, added the extensions one by one and stopped where I found the culprit extension that was taking my sleep away :).
You can unload project and reload the MVC project from solution
Right Click on MVC project in solution explorer -> "Unload Project"
Right Click on MVC project in solution explorer -> "Reload Project"
After this the Intellesense rework quickly.
Tools -> Options
Text Editor -> C# -> Intellisense
Ensure "Show completion list after a character is typed" is checked
VS2013 intellisense code completion
I'm not sure why it occurs, but when it happens to me I can recover Intellisense by simply restarting Visual Studio.
You're right, it's really annoying.
Sometimes RESET of VS settings can help:
TOOLS->Import and Export Settings Wizard->Reset all settings->checkbox "No, just reset settings, overwriting my current settings"->Next>Next>Next
I had messed them with RESHARPER, and this helped.
I found that the best way to fix IntelliSense issues is to simply unload the project in the solution explorer and load the project again. After that IntelliSense is always working for me and I do not loose bookmarks, breakpoints or any other settings.
I have found that if the build fails then the Intellisense seems to break. After fixing my build errors and rebuilding the project the Intellisense will work after reloading the particular Razor file.
In my case, restart didn't work.
So I did the following weird steps :
Closed the solution
Opened another solution
Verified that intellisense worked in this other solution.
Closed the other solution
Finally, reopened the first solution.
And the intellisense worked again.
Usually this happens when the buffers have an error in them. Most of the time the local cache error is cleared when you close a, windows form, for example and reopen therefore reloading it into memory. Many of the solutions above work but sometimes it as as simple as closing the item and designer and reopening the item.
Additionally you can try to force a reset by
Ctrl+K, Ctrl+I shows quick info
Ctrl+Shift+Space shows you param info
I tried lots of things which didn't work. In the end, I cut code to clipboard, recreated the controller and pasted code in. Problem solved!
I too have the same issue with Intellisense in my Text editor.
i just close example.cs file which is not providing Intellisense
and reopen that class without restart Visual Studio it
works for me.
Note : i don't have the same issue with all the .CS file in Solution Explorer
I use VS 2013 and I had the same problem.
My solution was update VS to last version. I my case Update 4.
Simply reference in project must match with assembly in GAC on computer (OS). Intellisense come from VS not from project.
I hope that will handy for some one.
... Yet another answer - but this was the cause of my pain: I'd installed Developer Assistant which had been working nicely but suddenly stopped providing suggestions. To get it working again:
options -> developer assistant -> Intellisense -> Default Visual Studio Intellisense
Took me 5 hours to find that :(
HTH.
Tools->Options->Text Editor->C# (or All Languages)->General
check the check box for enable Auto List Members and Parameter Information in right hand side pane.
If its not selected,select it.
Save everything and restart Visual Studio!
I get this exact same thing every time I work with one particular MVC5 project.
Restarting VS2013 does not work.
Deleting suo files does not work.
Resetting all tools settings does not work.
The only thing that ever works is removing the project from the solution and adding it again.
Seeing as I have to do this every day is is really quite annoying.
Especially when I have it set to reopen the last files I had open, I then need to track down the ones I was working on and re-open them instead of the popping up automagically..
I'm using VS 2013 with MVC 5. The solution for me was to add the following to Web.config:
<compilation debug="true" targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
Rushonerok's solution works great for me.
For anyone who doesn't know: <ProjectName>.v12.suo is a hidden file in project root folder. You must set on "Show hidden files" in your file browser to see it.
So far some these solutions have not worked for me.
I have the following Workaround
Simply declare the type you want to use explicitly in a new variable and use that instead of Model.
#model MyModel
MyModel mymodel = Model;
#mymodel.MyIntelisenseIsWorkingAgain
To solve this I closed Visual Studio Express 2013 and I reopened the Solution but double clicking on its .sln file directly from the file system. Opening it from the Start Page had my controllers intellisense broken.
Closing and opening the Visual Studio Solution worked for me.
Sometimes you close it by mistake. Try ctrl+space for windows or cmd+space for mac to turn it on.
I know I'm a bit late, but adding this to my App.config file did the trick!
<system.web>
<compilation>
<assemblies>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
</system.web>

Error when creating a Partial View in Visual Studio 2012 Express with Razor

I am creating a view in Microsoft Visual Studio 2012 Express and I want it to be a strongly-typed partial view, but I am getting the following error:
C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\VWDExpress\Item Templates\CSharp\Web\MVC 4\CodeTemplates\AddView\CSHTML\Empty.tt(-1,1) : error : There was a problem getting an AppDomain to run the transformation from the host. The process cannot continue.
I have not had any trouble creating views that are not partial views, strongly-typed or not.
Is simple...
Just restart Visual Studio.
http://blog.jongallant.com/2012/07/appdomain-process-cannot-continue.html#.UQwtQs6mg1I
I was using Visual Studio 2013 Professional and had the same issue and none of the following worked for me-
Restarted VS- didn't helped
There was no <NetFx40_LegacySecurityPolicy enabled="true" /> in devenv.exe.config file
Reinstalled Nuget Package Manager from VS > Tools > Extensions and Updates
Reinstalled MVC4 from Microsoft
Then I repaired my VS installation from Control Panel > Add/Remove Programs and my issue was resolved. I don't know what went wrong but this certainly needs attention by Microsoft Guys. Hope my answer helps out somebody in need.
I was using VS12 and Updated to VS13, i was unable to create views and was getting the above error, I just updated Nuget Package Manager by going in Tool --> Extension and Updates and everything worked fine for me.
As I was having same issue, I realized that this workaround may work for some of us, but... In my case, it did not work. But changing the devenv.exe.config, removing the line
<NetFx40_LegacySecurityPolicy enabled="true" />
did the trick. Hope it helps those like me, need to have that anoying thing for some older solutions... ;)

Visual Studio Error: (407: Proxy Authentication Required)

I am behind a corporate proxy server which requires credentials. I have been trying to connect to a TFS server (on tfspreview.com) with MS Visual Studio Pro 2012 for the last 2 hours with no success. Every attempt has been met with this error:
The integrated browser works fine when I initiate it. It asks me for my proxy login credentials and once entered, off I go. So there is some different method of connection happening here.
I have also navigated to the TFS server, and once in my project I clicked Open new instance of Visual Studio. The new instance fails with this message in the output:
HTTP code 407: Proxy Authentication Required
I have tried everything that I found on another post to no avail. I have made every edit and combination edits to devev.exe.config that I have found with no success.
Could it be that the 2010 version is somehow different than the 2012 Pro edition? I am running Windows 7.
Can anyone shed some light? Please?
Note: This problem also applies to Visual Studio 2013
After three days of searching, the solution fell into my lap.
Now, what happened was VS tried to do an automatic update but was stopped by the proxy. I was prompted for credentials and the check took place.
I was inspired to check the TFS server connection just for kicks in case that prompt would possibly establish a connection for the TFS server to tunnel through... lo and behold! It worked!
WORKAROUND:
Open TOOLS>Extensions & Updates
Click on Updates... in the left-hand menu
There will be a failure notice on screen and a link to enter your credentials. Click it and enter them.
Close the Extension manager.
Click TEAM>Connect to TFS server...
Enter the address and it will work!
Note: Some have suggested trying to use the proxy credential prompt by opening the integrated browser but this has not worked. I am not an expert but I think they are connecting through different channels within windows itself.
There is no editing of devenv.exe.config required for this to work.
It will be a pain to have to check for updates manually every time you need to connect to the server, but this is the best solution I have come up with until Microsoft fixes this issue permanently with an update or future release.
The situation is essentially that VS is not set up to go through a proxy to get to the resources it's trying to get to (when using FTP). This is the cause of the 407 error you're getting. I did some research on this and there are a few things that you can try to get this debugged. Fundamentally this is a bit of a flawed area in the product that is supposed to be reviewed in a later release.
Here are some solutions, in order of less complex to more complex:
If possible don't use the proxy for the specified domains that you're trying to get to.
Set up your proxy settings correctly Internet Explorer (even if you don't use it) as that affects system wide settings. Even go so far as to connect to the internet with internet explorer and leave it connected then go back and try again from VS.
In the devenv.exe.config add <servicePointManager expect100Continue="false" /> as laid out below:
<configuration>
<system.net>
<settings>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>
</configuration>
Add defaultProxy settings as follows:
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://your.proxyserver.ip:port"/>
</defaultProxy>
<settings>
...
Alternately you could try telling it to use system default (which should pull from internet explorer) like so:
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" />
</defaultProxy>
There is an older solution involving creating a plugin here
Hope this solves it for you.
While running Visual Studio 2012 behind a proxy, I received the following error message when checking for extension updates in the Visual Studio Gallery:
The remote server returned an unexpected response: (417) Expectation failed
A look around Google finally revealed a solution here:
Visual Studio 2012 Proxy Settings
http://www.jlpaonline.com/?p=176
Basically, he's saying the fix is to edit your devenv.exe.config file and change this:
<settings>
<ipv6 enabled="true"/>
</settings>
to this:
<settings>
<ipv6 enabled="true"/>
<servicePointManager expect100Continue="false"/>
</settings>
The solution that worked for me in both Visual Studio 2013 and Microsoft Test Manager (MTM) was to ensure that both devenv.exe.config and mtm.exe.config included this configurations section:
<system.net>
<settings>
<ipv6 enabled="true"/>
<servicePointManager expect100Continue="false"/>
</settings>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" />
</defaultProxy>
</system.net>
MTM did not have a system.net setting and the whole section was added immediately following the closing xml tag </appSettings>.
Download and install Fiddler
Open Fiddler and go to Rule menu to tick Automatically authenticate
Now open visual studio and click on sign-in button.
Enter your email and password.
Hopefully it will work
Using IDE configuration:
Open Visual Studio 2012, click on Tools from the file menu bar and then click Options,
From the Options window, expand the Source Control option, click on Plug-in Selection and make sure that the Current source control plug-in is set to Visual Studio Team Foundation Server.
Next, click on the Visual Studio Team Foundation Server option under Source Control and perform the following steps:
Check Use proxy server for file downloads.
Enter the host name of your preferred Team Foundation Server 2010 Proxy server.
Set the port to 443.
Check Use SSL encryption (https) to connect.
Click the OK button.
Using exe.config:
Modify the devenv.exe.config where IDE executable is like this:
<system.net> 
 <defaultProxy>  
 <proxy proxyaddress=”http://proxy:3128”
bypassonlocal=”True” autoDetect=”True” /> 
  <bypasslist> 
   <add address=”http://URL”/>  
 </bypasslist> 
 </defaultProxy> 
Declare your proxy at proxyaddress and remember bypasslist urls and ip addresses will be excluded from proxy traffic.
Then restart visual studio to update changes.
This helped in my case :
close VS instance
open Control Panel\User Accounts\Credential Manager
Remove TFS related credentials from vault
This is just a hack. You need to do it regulary ... :-(
Best regards,
Alexander
I was getting an "authenticationrequired" (407) error when clicking the [Sync] button (using the MS Git Provider), and this worked for me (VS 2013):
..\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://username:password#proxyip:port" />
</defaultProxy>
<settings>
<ipv6 enabled="false"/>
<servicePointManager expect100Continue="false"/>
</settings>
</system.net>
I think the magic for me was setting 'ipv6' to 'false' - not sure why (perhaps only IPv4 is supported in my case). I tried other ways as shown above, but I move the "settings" section AFTER "defaultProxy", and changed "ipv6", and it worked perfectly with my login added (every other way I tried in all other answers posted just failed for me).
Edit: Just found another work around (without changing the config file). For some reason, if I disable the windows proxy (it's a URL to a PAC file in my case), try again (it will fail), and re-enable the proxy, it works. Seems to cache something internally that gets reset when I do this (at least in my case).
I was trying to connect Visual Studio 2013 to Visual Studio Team Services, and am behind a corporate proxy. I made VS use the default proxy settings (as specified in IE's connection settings) by adding:
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" />
</defaultProxy>
<settings>
<ipv6 enabled="true"/>
</settings>
</system.net>
to ..\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config (running notepad as admin and opening the file from within there)
My case is when using two factor auth, outlook account and VS12.
I found out I have to
open IE (my corporate default browser)
log in to visual studio online account (including two factor auth)
connect again in VS12 (do the auth again for some reason)
I was having the same problem, and none of the posted solutions worked. For me the solution was:
Open Internet Explorer > Tools > Internet Options
Click Connections > LAN settings
Untick 'automatically detect settings' and 'use automatic configuration script'
This prevented the proxy being used, and I could then authenticate without problem.
I faced the same error with my Visual Studio Team Services account (formerly Visual Studio Online, Team Foundation Service).
I simply entered the credentials using the VS 2013 "Connect to Team Foundation Server" Window, and then connected it to the Visual Studio Team Services Team Project. It worked this way.
I got this error when running dotnet publish while connected to the company VPN. Once I disconnected from the VPN, it worked.

Visual Studio doesn't recognize #model directive

I'm having trouble getting Visual Studio to recognize the #model directive in MVC3. As a result, I'm not getting any Intellisense help. For example, I just loaded up the standard base MVC3 project in Visual Studio and it shows all sorts of errors in LogOn.cshtml since it can't figure out what the view model is. However, if I run the application everything works just fine. So I guess this is more of an annoyance than anything else.
If you have installed the ASP.NET MVC 3 Tools Update make sure you have set the webpages Version in your web.config:
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
...
</appSettings>
Then simply close and reopen the view and syntax highlighting and Intellisense should come back.
UPDATE:
Reinstalling ASP.NET MVC 3 Tools Update solves the problem.

Resources