Update:
Reading my initial analysis once again increases my impression that some of the necessary components are missing (for example, a dedicated ProjectFactory ) and / or connected incorrectly - from the MSDN documentation ProvideProjectFactoryAttribute Class :
ProvideProjectFactoryAttribute announces that the package provides a factory project.
And further:
If VSPackage claims to provide a factory project, it should create a factory and offer it to Visual Studio in the Initialize method of the package-derived class.
The package announces the provision of PythonProjectFactory , but (most likely) does not offer it VS, rather it is offered by the IronPython package. In turn, you provide arguments in the ProvideProjectFactory attribute ProvideProjectFactory , which PythonProjectFactory does not know when VS asks for it.
Therefore, you should at least provide the dedicated ProjectFactory yourself in accordance with the walkthrough, connect the classes accordingly, and see how this happens due to the problems described below.
Initial analysis:
At first glance, several problems arise here - have you followed any guidance on how to do this? In the case, please note that some of those that are easily detected by search engines are outdated. In any case, I will try to perform and / or compare your result with the Walkthrough: Part 1 - Creating a basic project system from the MSDN documentation for VS 2010; note that even this one is said to be outdated slightly in accordance with the “Community Content” section at the bottom of the page.
Here's what I looked into myself, given the code you submitted, compared to passing on the fly for more information:
You already realized that a duplicate fragment starting with a GUID above PythonProjectFactory does not make sense - this is, in fact, an attempt to register two packages at once, which, even if it is allowed syntactically (which I doubt), cannot work like that, because both are registered with the same GUID [cross-checking with the sample file in the "Checking the registration of the template" section confirms this suspicion, as it is expected that there is only one such fragment].
- Note that the corresponding GUID is a
PythonProjectFactory (according to the corresponding source code), see below for a more detailed description.
[Guid(PythonConstants.ProjectFactoryGuid)] public class PythonProjectFactory : ProjectFactory {
Given that .pkgdef is a generated file, the following question arises, due to which this duplication / violation occurs. When two generated artifacts end with the same GUID, the corresponding definition in the sources is most likely confused in some way, usually due to duplication of copying and copying. Therefore, you should check if (5cd7435c-7461-459f-80bc-c0c79e9d462f} is defined as indicated, although there may be one or two other reasons, see below.
A Package class needs to be identified using a GUID, and the VS wizard generates some of them already in Guids.cs and refers to the class definition, however, the following is missing in your fragment [cross-validation with the sample fragment in the section. To register a project template also confirms this omission]:
[Guid(GuidList.guidMyPackagePkgString)] public sealed class MyPackage : Package
It is also incorrect to MyPackage from PythonProjectPackage , but the PythonProjectFactory link still does not provide MyFactory (including a dedicated GUID), because the latter tells Visual Studio the folder location of your project template [see section Creating a skeleton project Factory]:
- While it is entirely possible to simply reuse all the functionality from the
PythonProjectFactory base class, inheritance is likely to be required simply because the factory must also have a dedicated GUID (as indicated in the walkthrough) in order to properly connect to the specified attributes.
It is probably unrelated, but still suspicious that your two blocks of code are not relevant , since the definition of the Package class indicates the Django project files (* .myproj); *. myproj, but as a result My Project files (* .myproj) are displayed; *. myproj.
- Have you accidentally mixed this with different builds or is it really the result of a clean one?
Good luck
Steffen opel
source share