Páginas

Visual Studio: package did not load correctly after update extension.

If you get something similar to this:

package [XamarinAndroidPackage]Source: 'Xamarin.AndroidTools' Description: Method not found: 'Void Mono.AndroidTools.AnalyticsService.ReportContextProperty(System.String[], System.String[])'. System.MissingMethodException: Method not found: 'Void Mono.AndroidTools.AnalyticsService.ReportContextProperty.....

This might be caused by one of the common issues Visual Studio can run into with updating extensions according to https://bugzilla.xamarin.com/show_bug.cgi?id=44162 and it's right!

The solution is to Clear MEF Component Cache! Clearing the ComponentModelCache folder might help.  See step 3 on the following guide:
https://developer.xamarin.com/guides/cross-platform/getting_started/visual_studio_with_xamarin/troubleshooting/uninstall-xamarinvs/ 

Also there is a Visual Studio extension to make you life easier:
https://visualstudiogallery.msdn.microsoft.com/22b94661-70c7-4a93-9ca3-8b6dd45f47cd

This extension clears the MEF cache on disk and lets Visual Studio rebuild it. The reason for clearing the MEF cache is that it can become corrupted. This ususally happens when installing or updating extensions or other Visual Studio components.

Typical errors that can be solved by clearing the component cache are:

  • Could not load package exception
  • Could not load assembly exception
  • Composition error when opening files
  • Missing syntax highlighting of some languages in VS

Getting "#!/bin/bash: No such file or directory"

If you are getting "#!/bin/bash: No such file or directory" when trying to run a bash script on mac written on Windows, the issue is the encoding

According to http://ss64.com/osx/syntax-shellscript.html

If you get an error like "#!/bin/bash: No such file or directory", that is typically an indication that the File encoding or line endings are wrong, use an editor like VI or TextWrangler (shows line encodings at the bottom of the edit window) the script file should be Unicode (UTF-8) and Unix (LF) line endings