예제 #1
0
        private void PreHandleCrmAssemblyProjects(Dictionary <string, string> replacementsDictionary)
        {
            var sdkVersionPicker = new SdkVersionPicker(_needsWorkflow, _needsClient);
            var result           = sdkVersionPicker.ShowModal();

            if (!result.HasValue || result.Value == false)
            {
                throw new WizardBackoutException();
            }

            _coreVersion   = sdkVersionPicker.CoreVersion;
            _clientVersion = sdkVersionPicker.ClientVersion;
            _clientPackage = sdkVersionPicker.ClientPackage;

            if (!string.IsNullOrEmpty(_clientVersion))
            {
                ProjectDataHandler.AddOrUpdateReplacements("$useXrmToolingClientUsing$",
                                                           Versioning.StringToVersion(_clientVersion).Major >= 8 ? "1" : "0", ref replacementsDictionary);
            }

            var coreVersion     = Versioning.StringToVersion(_coreVersion);
            var v462BaseVersion = new Version(9, 0, 2, 9);

            if ((_crmProjectType == ProjectType.Console && _clientPackage != Resource.SdkAssemblyExtensions) || coreVersion >= v462BaseVersion)
            {
                var targetFrameworkVersion = Versioning.StringToVersion(replacementsDictionary["$targetframeworkversion$"]);
                if (targetFrameworkVersion < new Version(4, 6, 2))
                {
                    ProjectDataHandler.AddOrUpdateReplacements("$targetframeworkversion$", "4.6.2", ref replacementsDictionary);
                }

                // 4.7.1 is max version for plug-ins & workflows Online
                if (targetFrameworkVersion >= new Version(4, 7, 2) && _crmProjectType == ProjectType.Plugin || _crmProjectType == ProjectType.Workflow)
                {
                    ProjectDataHandler.AddOrUpdateReplacements("$targetframeworkversion$", "4.7.1", ref replacementsDictionary);
                }
            }
            else
            {
                ProjectDataHandler.AddOrUpdateReplacements("$targetframeworkversion$", "4.5.2", ref replacementsDictionary);
            };
        }
        private void PreHandleCrmAssemblyProjects(Dictionary <string, string> replacementsDictionary)
        {
            var  sdkVersionPicker = new SdkVersionPicker(_needsWorkflow, _needsClient);
            bool?result           = sdkVersionPicker.ShowModal();

            if (!result.HasValue || result.Value == false)
            {
                throw new WizardBackoutException();
            }

            _coreVersion   = sdkVersionPicker.CoreVersion;
            _clientVersion = sdkVersionPicker.ClientVersion;
            _clientPackage = sdkVersionPicker.ClientPackage;

            if (!string.IsNullOrEmpty(_clientVersion))
            {
                ProjectDataHandler.AddOrUpdateReplacements("$useXrmToolingClientUsing$",
                                                           Versioning.StringToVersion(_clientVersion).Major >= 8 ? "1" : "0", ref replacementsDictionary);
            }
        }