Xamarin Tools for Visual Studio: Almost unusably slow - xamarin

I'm wondering if there are any workarounds for this issue, as I am plagued by frequent crashes -- though it isn't clear whether the crashes are caused by Resharper, Xamarin Tools or the mixture of C# and F# projects.
When I restart Visual Studio and load a solution containing Xamarin Forms projects, the entire display locks up. After one to three minutes, I get a pop-up saying that an update for Xamarin for Visual Studio is available (Clicking on the pop-up has no effect, so I'm assuming this is a false positive). A few seconds after that, it attempts to connect to my Mac, which is often unsuccessful as I work on my laptop and that connection is only available when I'm at home.
Only when the connection to the Mac has failed am I able to interact with Visual Studio, and then, about 30% of the time, attempting to build, clean or rebulid simply results in a pop-up saying "The operation could not be completed". The only way to fix that is to restart Visual Studio, causing the whole grinding process to restart again.
Xamarin themselves have referred me to these forums. Obviously this is not a pure software question, so I'll try to distill this into specific answerable questions.
Is there a way to prevent the false positive that tells me a new version of Xamarin for Visual Studio is available when it clearly isn't?
Is there a setting that I can use in order to opt in to connecting to the Mac, rather than attempting to make a connection and killing startup time when I know in advance that the connection will not be made?
Has the build problem "This operation could not be completed" been reported anywhere? I haven't found any instances of this problem related to Xamarin or Resharper. But it is frequent.

Does this consistently happen? We've had this problem over the years, but it's gotten much better. Make sure all your machines are synced with the latest Stable update. If on Beta/Alpha, this is typical as we push builds often. The strange part is that you say it's trying to update Xamarin Studio, we actually don't ship Xamarin Studio for Windows anymore: https://www.xamarin.com/faq#xpq6. So it might be a good idea to uninstall a previous version of Xamarin Studio on Windows if it's there.
This is a good point. It's something that might need a small papercut bug filed. Feel free to log an issue here and I can coordinate the status: (https://bugzilla.xamarin.com/enter_bug.cgi?product=Visual%20Studio%20Extensions). In the past I've seen a couple ways around this. 1) Make a seperate .sln that might be called .Windows which will only load Windows native projects (Android, UWP, etc). This way the step is skipped completely. 2) You can simply unload the iOS project until you need to reload the project and work on the iOS side. However I do agree there should be a project property/IDE setting that should say "Start Xamarin Mac Agent on Startup".
That error is really vague. We would need to gather some logs(log files can be gathered from %LOCALAPPDATA%\Xamarin\Log or using Help->Xamarin). This operation could not be completed typically has an error/exception following it like This operation could not be completed: Invalid Pointer. So we would need to dig into logs here and see if we can get a Stack Trace when it happens. I would also try deleting your .suo in the .vs hidden folder of your project directory.

Related

VS2015 Xamarin.Forms Android App: Debugging is Suddenly Broken

I have a Xamarin.Forms Android app that I have been developing in Visual Studio 2015 for several months.
Until today, I have been able to reliably debug the app in both the Android emulator and on a physical device. Now, suddenly, debugging the app in either of these environments results in numerous exceptions.
For example, during its startup sequence, my app initializes Xamarin Insights:
Insights.Initialize(apiKey, Forms.Context);
This has been working fine for months, but now it throws the following exception:
Java.Lang.SecurityException: ConnectivityService: Neither user 10133 nor current process has android.permission.ACCESS_NETWORK_STATE.
I can work around this exception, either by commenting the above code line or by explicitly assigning permission ACCESS_NETWORK_STATE, but it wasn't necessary previously and I believe it is a red hering, since it is one of numerous new random exceptions that occur when debugging the app in Visual Studio.
I have reverted my codebase to a known working revision (one that is being successfully used by beta testers) and nothing changes.
I have tried restarting Visual Studio and rebooting the computer. I have also tried cleaning the solution (both from within Visual Studio and by physically removing all build artefacts) but none of these efforts have helped.
I am guessing that something has been corrupted in Visual Studio, but in view of the time it takes to reinstall, I am hoping that someone may have a suggestion for a quicker fix.
As you said that it works well if you add the "uses-permission" in the Mainfest, if so, do you debug your app in release mode or debug mode?
Like this document here:
https://developer.xamarin.com/guides/android/advanced_topics/working_with_androidmanifest.xml/
In the Release build version of the manifest (at obj/Debug/android/AndroidManifest.xml), these permissions are not automatically configured. You could add it from the project property.

Visual Studio 2013 Aborting When Opening Property Sheets for Project

I don't know when this started, but I discovered that Visual Studio 2013 Update 5 aborts when attempting to open properties for a project within a solution. It seems to only happen when we have more than one project in the solution.
I've been able to reproduce it in two circumstances:
The first project is C++ and the second project is Fortran. Right-clicking on the first project and selecting Properties crashes Visual Studio without a crash dump or any kind of pop-up notification. Visual Studio just ceases to exist. Right-clicking on the Fortran project brings up the property sheet without any problem.
The second circumstance is with two projects, both C++. In this case, I'm able to open properties successfully for the first project, but not for the second one.
In every case I've tried where there's a one-to-one solution and project, it's working fine. A colleague who's working with VS 2013 Update 4 verified that the crash occurs for him as well.
We don't know when this started, but historically, we've opened these property sheets many, many times. However, it's probably been a few months since I've worked on a mixed-language process, and same with my colleague.
I've turned on logging and there was a complaint in the log about two versions of the Desktop SDK having the same internal ID. I removed one of those altogether, but that didn't seem to affect anything. It's also not clear if that error has any relationship to the crash.
I've also done a repair on Visual Studio, and that did not correct the problem.
I've also tried deleting the .suo and .user files. Again, no luck.
I've done quite a bit of googling but haven't found anything that matches this specific problem.
Any ideas?
Thank you,
Doug

Visual Studio 2010 crashes when doing a Find all references

Complete EDIT [I messed up the previous question]
A dialogue box shows up saying
[title: find definition]
Preparing files for project '_'
Then it crashes half way.
I've tried to do it on two different computers, but it still crashes.
It works for other smaller solutions, but this is my biggest one. about 16 projects.
When you say Visual Studio crashes, does it just go into the "Not Responding" state or does it have a full on crash (wanting to submit error report etc) ?
The Not Responding state is normal if it is just that (ie. just let it keep running).
If you are still struggling, I have used Notepad++ to do search and replaces on huge projects. You would need to ensure all your projects are Checked-out first (if under source control) and then run a Find in Files search and replace over all your projects.
Sorry I have nothing more enlightening for you.
I also face this issue; a Bug related to this is already present in MS Connect, but unfortunately no workaround is specified
Visual Studio 2010 Crashes when "Find all Reference" is ran

Compile on-the-fly in Visual Studio 2008 very slow

I'm experiencing some performance problems. When I edit a file, Visual Studio 2008 performs a background (on-the-fly) compilation and then, it updates the error list. During this time, the cursor in the file editor disappears, and the keys I press to move or type more character are buffered.
Once the background compilation is finished, the changes are reflected in the editor (1 - 2 seconds). Every time I edit a file, which happens often, this happens.
How can I fix this problem? If this is not possible, can I disable this automatic build?
I had an odd performance-related issue today. My Microsoft Visual Studio seemed to be taking far too long to perform even the simplest of operations. I Googled around and tried a few ideas that people had such as disabling add-ins or clearing Visual Studio’s recent projects list but those suggestions didn’t seem to solve the problem. I remembered that the Windows SysInternals website had a tool called Process Monitor that would sniff registry and file accesses by any running program.
It seemed to me that Visual Studio was up to something and Process Monitor should help me figure out what it was. I downloaded the most recent version, and after fiddling around a bit with its display filters, ran it and to my horror, I saw that Visual Studio was so slow because it was accessing the more than 10,000 folders in C:\Users\krintoul\AppData\Local\Microsoft\WebSiteCache on most IDE operations. I’m not sure why there were that many folders and moreover, wasn’t sure what Visual Studio was doing with them, but after I zipped those folders up and moved them somewhere else, Visual Studio’s performance improved tremendously.
The Windows SysInternals website has a number of other useful utilities for network management, security, system information and more. Check it out. I’m sure you’ll find something of value.

Visual Studio Hosting Process and "The operation could not be completed"

When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message "The operation could not be completed".
The solution to this is to turn off the "Visual Studio Hosting Process".
The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available. OK, so this isn't a big deal, but I'm always getting this message no matter what machine I use (and it might be nice once in a while to use the rewrite and execute functionality).
Am I doing something wrong? How come this "feature" within VS seems to complain so readily? Do other people have success with enabling the hosting process and making use of it?
The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available.
The Visual Studio Hosting Process is not needed to allow Edit and Continue. It is used for "Design time expression Evalutation" in the case where the project is a dll rather than an EXE. It is also used to provide debugging for partial trust scenarios. See the documentation for everything it does.
It is highly unlikely it does anything you need, so don't feel bad turning it off.
Is your project output folder set to a network share?
If so, try changing it to a local folder and see what happens. It appears that VS is not always able to terminate the process if the host exe is running from a share.
The other possibility is that the project is open and running in debug mode on another instance of Visual Studio - although I suspect you will allready have ensured this is not the case.
I honestly have never seen this message and I work with Visual Studio for at least 8 hours a day. Is this reproducible on other machines? If so is there anything weird or abnormal in your code that could cause this to crash?
I use 4 different machines and have got this situation on all of them. I understand what is causing the problem - it is that the VS hosting process isn't terminating after the first debug session ends, which means that the next time that you try to compile the exe the hosting process is locking the exe and preventing compilation. Another solution therefore is to use Task Manager to kill the VS hosting process and compile and debug as normal but thats even more of a hassle!
I can't think that its anything in my code that would be causing this - its probably a VS issue itself isn't it?
Here's the anwser: disable "Enable he Visual Studio hosting process" in he debug tab of your projects properties.
I found it here:
http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/
There are several causes and workarounds regarding to this problem and you might try the following ones that are useful most of the time:
Delete the "Your_Solution_FileName.suo" file and restart Visual Studio.
or
Right click on the project and select Unload Project and then click Reload Project by right clicking on the project again might also fix it.

Resources