Bug 37957 - XS 6 Preview Code Templates -> Add does not do anything
Summary: XS 6 Preview Code Templates -> Add does not do anything
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Bugzilla
: 38453 ()
Depends on:
Reported: 2016-01-23 23:29 UTC by John Miller [MSFT]
Modified: 2016-09-16 14:52 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description John Miller [MSFT] 2016-01-23 23:29:09 UTC

   I updated to the 6.0 preview from http://developer.xamarin.com/releases/studio/xamarin.studio_6.0/xamarin.studio_6.0/#New_visual_style_and_Dark_theme

   I can not add any new code templates. http://screencast.com/t/oGo3qoS3jlOM

**Steps to Reproduce:**

   XS -> Preferences -> Code Templates -> Add

**Actual Results:**

   Nothing happens.

**Expected Results:**

   The Add New window should appear.

**Build Date & Platform:**

=== Xamarin Studio ===

Version 6.0 (build 3668)
Installation UUID: e01c3049-a2d2-4e0a-aad8-afe6fb627c4d
	Mono 4.3.0 (mono-4.3.1-branch/37d269c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 403002114

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.2 (9548)
Build 7C68

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 7322991
Branch: master
Build date: 2015-12-08 16:20:29-0500

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/johnmiller/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 600003668
Git revision: 23e9d5d22133ca5a7c56b26644ab59a4626bccdb
Build date: 2016-01-20 15:12:22-05
Xamarin addins: bca6749910827de4af7eab7a925ff4ccf2bda06a
Build lane: monodevelop-lion-roslyn-dark-skin-64bit

=== Operating System ===

Mac OS X 10.11.2
Darwin Johns-Work-MacBook-Pro.local 15.2.0 Darwin Kernel Version 15.2.0
    Fri Nov 13 19:56:56 PST 2015
    root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Comment 1 Matt Ward 2016-01-25 11:20:34 UTC
I see an exception in the IDE logs when the Add button is clicked.

An unhandled exception has occured. Terminating Xamarin Studio? False
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.TextEditor.Utils.ImmutableText..ctor (System.String str) [0x00006] in monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableText.cs:134 
  at Mono.TextEditor.TextDocument.set_Text (System.String value) [0x00028] in monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:233 
  at MonoDevelop.SourceEditor.Wrappers.TextDocumentWrapper.MonoDevelop.Ide.Editor.ITextDocument.set_Text (System.String value) [0x00000] in monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ITextDocumentWrapper.cs:163 
  at MonoDevelop.Ide.Editor.TextEditor.set_Text (System.String value) [0x00005] in monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs:340 
  at MonoDevelop.Ide.CodeTemplates.EditTemplateDialog..ctor (MonoDevelop.Ide.CodeTemplates.CodeTemplate template, Boolean isNew) [0x000e4] in monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:62 
  at MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.ButtonAddClicked (System.Object sender, System.EventArgs e) [0x00006] in monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:134 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/
Comment 2 xamarin-release-manager 2016-01-25 11:44:12 UTC
Fixed in version (master)

Author: Matt Ward
Commit: 01b9e22d6ad7be4251414bddb7964fd9b4bb5874 (mono/monodevelop)
Comment 3 Matt Ward 2016-02-04 14:23:54 UTC
*** Bug 38453 has been marked as a duplicate of this bug. ***
Comment 4 Mohit Kheterpal 2016-09-16 14:52:14 UTC
I have checked this issue and observed that this issue has been fixed as shown in screencast : http://www.screencast.com/t/joKAaaWg

Using XamarinStudio-

Hence closing this issue.