From ca1abf60fd926c26b5967c96ba50f65a4dff88a9 Mon Sep 17 00:00:00 2001 From: Eric Labahosky Date: Sun, 24 Jan 2016 08:52:18 -0500 Subject: [PATCH] converted controls to v.4.5.2 added error trap for missing WIF 3.5 removed .NET 4.5 requirement in the manifest (it was causing installation failures) --- .../CrmCodeGenerator.Controls.csproj | 221 +++++++++--------- .../Properties/Resources.Designer.cs | 134 +++++------ .../Properties/Settings.Designer.cs | 56 +++-- .../Helpers/ConnectionHelper.cs | 24 +- .../source.extension.vsixmanifest | 3 +- 5 files changed, 221 insertions(+), 217 deletions(-) diff --git a/CrmCodeGenerator.Controls/CrmCodeGenerator.Controls.csproj b/CrmCodeGenerator.Controls/CrmCodeGenerator.Controls.csproj index df291b4..96f3c5f 100644 --- a/CrmCodeGenerator.Controls/CrmCodeGenerator.Controls.csproj +++ b/CrmCodeGenerator.Controls/CrmCodeGenerator.Controls.csproj @@ -1,110 +1,113 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {CE17A54E-0661-429F-AFDC-272E8668B14E} - library - Properties - CrmCodeGenerator.Controls - CrmCodeGenerator.Controls - v4.0 - Client - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - - - SigningKey.snk - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - FileSelector.xaml - - - MultiSelectComboBox.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {CE17A54E-0661-429F-AFDC-272E8668B14E} + library + Properties + CrmCodeGenerator.Controls + CrmCodeGenerator.Controls + v4.5.2 + + + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + + + SigningKey.snk + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + FileSelector.xaml + + + MultiSelectComboBox.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + \ No newline at end of file diff --git a/CrmCodeGenerator.Controls/Properties/Resources.Designer.cs b/CrmCodeGenerator.Controls/Properties/Resources.Designer.cs index e06cf66..5af3140 100644 --- a/CrmCodeGenerator.Controls/Properties/Resources.Designer.cs +++ b/CrmCodeGenerator.Controls/Properties/Resources.Designer.cs @@ -1,71 +1,63 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MultiSelectComboBox.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MultiSelectComboBox.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CrmCodeGenerator.Controls.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CrmCodeGenerator.Controls.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/CrmCodeGenerator.Controls/Properties/Settings.Designer.cs b/CrmCodeGenerator.Controls/Properties/Settings.Designer.cs index 2722699..586d146 100644 --- a/CrmCodeGenerator.Controls/Properties/Settings.Designer.cs +++ b/CrmCodeGenerator.Controls/Properties/Settings.Designer.cs @@ -1,30 +1,26 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MultiSelectComboBox.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CrmCodeGenerator.Controls.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/CrmCodeGenerator.VSPackage/Helpers/ConnectionHelper.cs b/CrmCodeGenerator.VSPackage/Helpers/ConnectionHelper.cs index 91d25da..588c5db 100644 --- a/CrmCodeGenerator.VSPackage/Helpers/ConnectionHelper.cs +++ b/CrmCodeGenerator.VSPackage/Helpers/ConnectionHelper.cs @@ -27,12 +27,26 @@ public static ObservableCollection GetOrgList(Settings settings) } public static OrganizationDetailCollection GetOrganizations(Settings settings) { - var connection = Microsoft.Xrm.Client.CrmConnection.Parse(settings.GetDiscoveryCrmConnectionString()); - var service = new Microsoft.Xrm.Client.Services.DiscoveryService(connection); + try + { + var connection = Microsoft.Xrm.Client.CrmConnection.Parse(settings.GetDiscoveryCrmConnectionString()); + var service = new Microsoft.Xrm.Client.Services.DiscoveryService(connection); - var request = new Microsoft.Xrm.Sdk.Discovery.RetrieveOrganizationsRequest(); - var response = (Microsoft.Xrm.Sdk.Discovery.RetrieveOrganizationsResponse)service.Execute(request); - return response.Details; + var request = new Microsoft.Xrm.Sdk.Discovery.RetrieveOrganizationsRequest(); + var response = (Microsoft.Xrm.Sdk.Discovery.RetrieveOrganizationsResponse)service.Execute(request); + return response.Details; + } + catch (System.IO.FileNotFoundException e) + { + if (e.Message.Contains("Microsoft.IdentityModel")) + { + throw new Exception("Unable to load Windows Identity Foundation 3.5. This is a feature that can be enabled on windows 8+ or downloaded for earlier versions -> https://www.microsoft.com/en-nz/download/details.aspx?id=17331 ", e); + } + else + { + throw e; + } + } } } } diff --git a/CrmCodeGenerator.VSPackage/source.extension.vsixmanifest b/CrmCodeGenerator.VSPackage/source.extension.vsixmanifest index c9fe9f5..6e682e7 100644 --- a/CrmCodeGenerator.VSPackage/source.extension.vsixmanifest +++ b/CrmCodeGenerator.VSPackage/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + CrmCodeGenerator.VSPackage Allows you to generate CRM 2011/2013 schema files. Much like CrmSrvUtil.exe but with a lot more features; select entities (smaller code/assembly), runs in VisualStudio, T4 templates for control of how code is generated (also allows other languages), Template is saved to project, connection info save to SUO & so that you can modify it as needed. @@ -17,7 +17,6 @@ -