Example #1
0
        private void PostHandleCrmAssemblyProjects(Project project, IVsPackageInstaller installer)
        {
            try
            {
                project.DTE.SuppressUI = true;

                //Install all the NuGet packages
                project = (Project)((Array)_dte.ActiveSolutionProjects).GetValue(0);
                NuGetProcessor.InstallPackage(installer, project, Resource.SdkAssemblyCore, _coreVersion);
                if (_needsWorkflow)
                {
                    NuGetProcessor.InstallPackage(installer, project, Resource.SdkAssemblyWorkflow, _coreVersion);
                }
                if (_needsClient)
                {
                    NuGetProcessor.InstallPackage(installer, project, _clientPackage, _clientVersion);
                }

                ProjectWorker.ExcludeFolder(project, "bin");
                ProjectWorker.ExcludeFolder(project, "performance");

                if (_signAssembly)
                {
                    Signing.GenerateKey(project, _destDirectory);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.LogException(Logger, Resource.ErrorMessage_ErrorProcessingTemplate, ex);
                MessageBox.Show(Resource.ErrorMessage_ErrorProcessingTemplate);
            }
        }
Example #2
0
        private void PostHandleUnitTestProjects(Project project, IVsPackageInstaller installer)
        {
            NuGetProcessor.InstallPackage(installer, project, ExtensionConstants.MsTestTestAdapter, null);
            NuGetProcessor.InstallPackage(installer, project, ExtensionConstants.MsTestTestFramework, null);

            if (_unitTestFrameworkPackage != null)
            {
                NuGetProcessor.InstallPackage(installer, project, _unitTestFrameworkPackage, null);
            }
        }
        private void PostHandleUnitTestProjects(Project project, IVsPackageInstaller installer)
        {
            NuGetProcessor.InstallPackage(_dte, installer, project, "MSTest.TestAdapter", "1.1.18");
            NuGetProcessor.InstallPackage(_dte, installer, project, "MSTest.TestFramework", "1.1.18");

            if (_unitTestFrameworkPackage != null)
            {
                NuGetProcessor.InstallPackage(_dte, installer, project, _unitTestFrameworkPackage, null);
            }
        }
Example #4
0
        private static void AddPackage(IVsPackageInstaller installer, CustomTemplateNuGetPackage package, Project project)
        {
            string packageVersion = string.IsNullOrEmpty(package.Version) ?
                                    null :
                                    package.Version;

            try
            {
                NuGetProcessor.InstallPackage(installer, project, package.Name, packageVersion);
            }
            catch (Exception ex)
            {
                ExceptionHandler.LogException(Logger, $"{Resource.ErrorMessage_FailedToAddNuGetPackage}: {package.Name} {packageVersion}", ex);
            }
        }
        private void PostHandleCrmAssemblyProjects(Project project, IVsPackageInstaller installer)
        {
            try
            {
                project.DTE.SuppressUI = true;

                //Pre-2015 use .NET 4.0
                if (Versioning.StringToVersion(_coreVersion).Major < 7)
                {
                    project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.0";
                }
                //Plug-in & workflows use .NET 4.5.2
                else if (_crmProjectType == ProjectType.Plugin || _crmProjectType == ProjectType.Workflow)
                {
                    project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.5.2";
                }
                //Console v9+ use .NET 4.6.2 //TODO: Getting "Project Unavailable" message when finished but project builds fine
                //else if (_crmProjectType == ProjectType.Console && Versioning.StringToVersion(_coreVersion).Major >= 9)
                //    project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.6.2";

                //Install all the NuGet packages
                project = (Project)((Array)_dte.ActiveSolutionProjects).GetValue(0);
                NuGetProcessor.InstallPackage(installer, project, Resource.SdkAssemblyCore, _coreVersion);
                if (_needsWorkflow)
                {
                    NuGetProcessor.InstallPackage(installer, project, Resource.SdkAssemblyWorkflow, _coreVersion);
                }
                if (_needsClient)
                {
                    NuGetProcessor.InstallPackage(installer, project, _clientPackage, _clientVersion);
                }

                ProjectWorker.ExcludeFolder(project, "bin");
                ProjectWorker.ExcludeFolder(project, "performance");

                if (_signAssembly)
                {
                    Signing.GenerateKey(project, _destDirectory);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.LogException(Logger, Resource.ErrorMessage_ErrorProcessingTemplate, ex);
                MessageBox.Show(Resource.ErrorMessage_ErrorProcessingTemplate);
            }
        }
        private void PostHandleCrmAssemblyProjects(Project project, IVsPackageInstaller installer)
        {
            try
            {
                project.DTE.SuppressUI = true;

                //Pre-2015 use .NET 4.0
                if (Versioning.StringToVersion(_coreVersion).Major < 7)
                {
                    project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.0";
                }

                //Install all the NuGet packages
                project = (Project)((Array)(_dte.ActiveSolutionProjects)).GetValue(0);
                NuGetProcessor.InstallPackage(_dte, installer, project, Resources.Resource.SdkAssemblyCore, _coreVersion);
                if (_needsWorkflow)
                {
                    NuGetProcessor.InstallPackage(_dte, installer, project, Resources.Resource.SdkAssemblyWorkflow, _coreVersion);
                }
                if (_needsClient)
                {
                    NuGetProcessor.InstallPackage(_dte, installer, project, _clientPackage, _clientVersion);
                }


                ProjectWorker.ExcludeFolder(project, "bin");
                ProjectWorker.ExcludeFolder(project, "performance");

                if (_signAssembly)
                {
                    Signing.GenerateKey(_dte, project, _destDirectory);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Processing Template: " + ex.Message);
            }
        }