From 990c1f86a233a2efa35a1fde7a698ee33a953e4c Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 5 Jun 2015 10:05:49 -0700 Subject: [PATCH] #188 Can't create web role or worker role Changes the UWP project factory GUID to sort before the main Pyhton project factory to avoid failing a test during template search. Removes an incorrect comment from ProvideLanguageTemplatesAttribute. Adds a test to ensure templates can be found. --- .../ProvideLanguageTemplatesAttribute.cs | 12 --------- .../ImportWizard/ProjectCustomizations.cs | 2 +- Python/Product/Uwp/Guids.cs | 2 +- .../PythonBackgroundService.pyproj | 2 +- Python/Tests/Core.UI/BasicProjectTests.cs | 25 +++++++++++++++++++ 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Python/Product/Django/ProvideLanguageTemplatesAttribute.cs b/Python/Product/Django/ProvideLanguageTemplatesAttribute.cs index 950babbff6..f5ab4b94a8 100644 --- a/Python/Product/Django/ProvideLanguageTemplatesAttribute.cs +++ b/Python/Product/Django/ProvideLanguageTemplatesAttribute.cs @@ -17,16 +17,6 @@ using Microsoft.VisualStudio.Shell; namespace Microsoft.PythonTools.Django { - - /// - /// - /// This attribute associates a file extension to a given editor factory. - /// The editor factory may be specified as either a GUID or a type and - /// is placed on a package. - /// - /// This differs from the normal one in that more than one extension can be supplied and - /// a linked editor GUID can be supplied. - /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] internal sealed class ProvideLanguageTemplatesAttribute : RegistrationAttribute { private readonly string _projectFactory, _languageName, _package, _languageGuid, _description, _templateGroup, @@ -45,8 +35,6 @@ public ProvideLanguageTemplatesAttribute(string projectFactory, string languageN _webProjectGuid = webProjectGuid; } - - /// /// /// Called to register this attribute with the given context. The context /// contains the location where the registration inforomation should be placed. diff --git a/Python/Product/PythonTools/PythonTools/Project/ImportWizard/ProjectCustomizations.cs b/Python/Product/PythonTools/PythonTools/Project/ImportWizard/ProjectCustomizations.cs index 4ee25f6202..81dc0e8551 100644 --- a/Python/Product/PythonTools/PythonTools/Project/ImportWizard/ProjectCustomizations.cs +++ b/Python/Product/PythonTools/PythonTools/Project/ImportWizard/ProjectCustomizations.cs @@ -214,7 +214,7 @@ Dictionary groups globals = project.AddPropertyGroup(); } - AddOrSetProperty(globals, "ProjectTypeGuids", "{c85cbf2e-4147-4e9d-87e0-9a2fbf407f6e};{888888A0-9F3D-457C-B088-3A5042F75D52}"); + AddOrSetProperty(globals, "ProjectTypeGuids", "{2b557614-1a2b-4903-b9df-ed20d7b63f3a};{888888A0-9F3D-457C-B088-3A5042F75D52}"); } } } diff --git a/Python/Product/Uwp/Guids.cs b/Python/Product/Uwp/Guids.cs index abd2d60a8e..d5bf5981b4 100644 --- a/Python/Product/Uwp/Guids.cs +++ b/Python/Product/Uwp/Guids.cs @@ -19,7 +19,7 @@ namespace Microsoft.PythonTools.Uwp { static class GuidList { public const string guidUwpPkgString = "0a078d3c-15a9-47f5-8418-9ee5db43993d"; - public const string guidUwpFactoryString = "c85cbf2e-4147-4e9d-87e0-9a2fbf407f6e"; + public const string guidUwpFactoryString = "2b557614-1a2b-4903-b9df-ed20d7b63f3a"; public const string guidUwpPropertyPageString = "700c8e09-f81c-4fb8-a386-508fb48c372d"; public static readonly Guid guidOfficeSharePointCmdSet = new Guid("d26c976c-8ee8-4ec4-8746-f5f7702a17c5"); } diff --git a/Python/Product/Uwp/Templates/Projects/BackgroundService/PythonBackgroundService.pyproj b/Python/Product/Uwp/Templates/Projects/BackgroundService/PythonBackgroundService.pyproj index 0e2eaa0609..08b3bd35c5 100644 --- a/Python/Product/Uwp/Templates/Projects/BackgroundService/PythonBackgroundService.pyproj +++ b/Python/Product/Uwp/Templates/Projects/BackgroundService/PythonBackgroundService.pyproj @@ -20,7 +20,7 @@ $projectname$_TemporaryKey.pfx $currentuiculturename$ - {c85cbf2e-4147-4e9d-87e0-9a2fbf407f6e};{888888A0-9F3D-457C-B088-3A5042F75D52} + {2b557614-1a2b-4903-b9df-ed20d7b63f3a};{888888A0-9F3D-457C-B088-3A5042F75D52} {86767848-40B4-4007-8BCC-A3835EDF0E69} 3.5 true diff --git a/Python/Tests/Core.UI/BasicProjectTests.cs b/Python/Tests/Core.UI/BasicProjectTests.cs index bea8e3f715..5067572e66 100644 --- a/Python/Tests/Core.UI/BasicProjectTests.cs +++ b/Python/Tests/Core.UI/BasicProjectTests.cs @@ -60,6 +60,31 @@ public static void DoDeployment(TestContext context) { PythonTestData.Deploy(); } + [TestMethod, Priority(0), TestCategory("Core")] + [HostType("VSTestHost")] + public void TemplateDirectories() { + var languageName = PythonVisualStudioApp.TemplateLanguageName; + using (var app = new VisualStudioApp()) { + var sln = (Solution2)app.Dte.Solution; + + foreach (var templateName in new[] { +#if DEV14_OR_LATER + "BackgroundService.zip", +#endif + PythonVisualStudioApp.PythonApplicationTemplate, + PythonVisualStudioApp.BottleWebProjectTemplate, + PythonVisualStudioApp.DjangoWebProjectTemplate + }) { + var templatePath = sln.GetProjectTemplate(templateName, languageName); + Assert.IsTrue( + File.Exists(templatePath) || Directory.Exists(templatePath), + string.Format("Cannot find template '{0}' for language '{1}'", templateName, languageName) + ); + Console.WriteLine("Found {0} at {1}", templateName, templatePath); + } + } + } + [TestMethod, Priority(0), TestCategory("Core")] [HostType("VSTestHost")] public void UserProjectFile() {