Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_Definitions folder gets added when creating a new project #68

Open
codewithtyler opened this issue Jun 3, 2015 · 5 comments
Open

_Definitions folder gets added when creating a new project #68

codewithtyler opened this issue Jun 3, 2015 · 5 comments
Labels

Comments

@codewithtyler
Copy link
Member

After creating and install a JavaScript project using SideWaffle, there is a _Definitions folder that is created during the project creation. This was originally found in ligershark/side-waffle#271.

While investigating this problem I found that there are 3 places that reference the _Definitions folder in TemplateBuilder. These are:

  • GetItemTemplateNameFromVSTemplatePath01.proj
  • ModifyProjectTask.proj
  • _modifyproj.csproj

GetItemTemplateNameFromVSTemplatePath01.proj simply points the VSTemplatefile path to the vstemplate file in the _Definitions folder.

The ModifyProjectTask.proj has an ItemGroup element containing another nested element called ItemsToRemove. This points to the vstemplate.xml file in the _Definitions folder.

The _modifyproj.csproj contains a Content element nested inside one of the ItemGroup elements. This content element adds the _Definitions_project.vstemplate.xml file. However, it's not very clear what this is used for.

From what I can tell the _modifyproj.csproj file is probably what is preventing the _Definitions folder from being removed on build. However, I'd like to receive some additional information regarding these files to make sure I'm understanding this correctly.

@sayedihashimi can you confirm what I have found so far?

@sayedihashimi
Copy link
Member

@RandomlyKnighted

  • GetItemTemplateNameFromVSTemplatePath01.proj
  • ModifyProjectTask.proj
  • _modifyproj.csproj

These files are all just sample files.

  • GetItemTemplateNameFromVSTemplatePath01.proj - shows how to use the GetItemTemplateNameFromVSTemplatePath task
  • ModifyProjectTask.proj - shows how to use the ModifyProject task
  • _modifyproj.csproj - used by ModifyProjectTask.proj

When a template build is happening
ligershark.templates.targets is imported and a step of that calls the ModifyProject task is called. That is the guy who removes the items from the project file.

I think what we should do is add the SideWaffle Project Template Files to a JS project and then see if adds an additional item for the folder itself. Then add that to the list of items to remove which is then passed to ModifyProject.

@codewithtyler
Copy link
Member Author

@sayedihashimi thanks for the clarification.

Something I'm still a bit confused about. The OP said that the issue occurred when attempting to create a JavaScript project; however, in the preprocess.xml and vstemplate files they provided it shows that they had created a C# WPF application. So do I create a WPF application and test that or do I need to actually test with something like a Node.js Web Application project?

@kentcooper
Copy link
Member

I think the OP didn't have the right project name in his preprocess and vstemplate files. After @sayedihashimi asked him if the name of his project was really WpfApplication.csproj he posted that he got it working so I'm guessing he got the correct project name after that. Based off the original question I think the OP was trying to use one the actual JavaScript Projects (used in the Windows Store) not a Web Project.

@sayedihashimi
Copy link
Member

I agree with Kent.

@codewithtyler
Copy link
Member Author

Ok, so I haven't even been able to get as far as the OP did with creating a JavaScript template. So far I've ran into two issues that I've only been able to replicate when creating a JavaScript project template. (I've tested this on two different machines using the latest version of SideWaffle.) Anytime I do a C# project it works fine.

The first problem I run into is when I try to add a template reference I get the following error message:

attempted_to_add_template_reference

I'm not sure where it gets _project1.vstemplate because it adds the _project.vstemplate file like it should in the _Definitions folder.

The second one happens immediately after I've added the template reference (somewhat unsuccessfully due to the error above). Once I've updated the vstemplate and _preprocess.xml files I go to build the project and I get the following error message.

Error 1 The project file could not be loaded. Could not find file 'C:\Users\tbhughes\Documents\Visual Studio 2013\Projects\JS_VSIXProjectTest\App1\.jsproj'.

I've went through the VSIX .csproj file and the file path looks good. I'm not sure why it's missing the App1 before the .jsproj.

Am I missing something here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants