How do I add a specific, NON-PROJECT Folder to a MultiProjectTemplate?
I.e I add a projectCollection to TemplateContent with all of my involved projects as ProjectTempateLink s inside.
How do I add a non-project related folder?
I've tried Folder both inside TemplateContent and inside a Project inside TemplateContent, but it doesn't work.
Looking at the schema http://msdn.microsoft.com/en-us/library/xwkxbww4%28v=VS.100%29.aspx it should be supported? Or is there an issue with using ProjectCollection and another tag inside TemplateContent
Not so much solved, as a workaround made:
I made a blank C# project, included the files necessary.
I then made a single project-template of this, then added it to my multi-project template.
It's silly that It's not possible to add a non-project related folder, but hey...
Related
I created a simple standalone SQL-table-to-class generator as a WPF application.
When I save files (e.g. a .cs class file) from that application into the directory structure of a separate web application I'm working on, it is of course not added to the solution. I have to manually add it in.
Is there a way I can automatically tag it/flag it or whatever, to be included in the web application solution?
The only solution I know of is to manually modify the .proj file and add a content include directive for the directories you want with a wildcard.
<Content Include="SomeDirectory\*" />
You will need to do this for each directory and it isn't recursive. The major down-side though, is that you must reload the project for it to pick up new files.
Personally, I consider this to be a bit of hack and would never use it in a serious project.
I am using TFS 2012 (online version).
Situation:
I made a solution that had multiple projects inside of it. I added it to TFS via the Visual Studio interface ("Add solution to Source Control"). That all worked fine.
Later I decided on a radical redesign of the code. I was not sure if I wanted it to go beyond the concept so I kept it local.
Now it is something I want to use. The new version has two projects that have the same name space as two projects in the old solution. When I add this solution to TFS the two projects that share a name with a project in another solution do not get added to the new source control "folder" (for lack of a better name).
OLD Solution:
myapp.webstuff
myapp.model
myapp.dal
myapp.interface
NEW solution:
myapp.mobilestuff
myapp.model <-- not added to source control
myapp.dal <-- not added to source control
myapp.webservices
TFS
Folder: BuildScripts
Folder: OldSolution
Folder: NewSolution
I think it has something to with the name of the two projects being the same. It must view them as the same and not load them to the source control.
I figured it out. Although the projects themselve would not be added to the source control library, adding files in the project to the library would add the project.
So just add the files in the project and the project will come along.
Looking to make a Solution/Multiproject Template.
While I'm aware a solution template does not exist, I've been researching/trying with some of success. (Link from here (http://stackoverflow.com/questions/2717110/how-to-create-a-solution-template-in-vs2010) have been a big help.
The only issue I'm facing is that, when creating a project from my template, the solution contains brand-new copies of all of the projects involved. What I require is that only ONE project is made as a fresh copy, and that the other projects in the template should reference already-existing projects.
I've made single project templates that hold the DLL references to other projects (which is fine, but it's not what I need.) I need a multi-project template where all but one project involved reference already existing projects...
How would I go about this?
edit:
I'm also finding that any dbml designer.cs that's added to a project are not included in the newly generated solution/projects. They are copied across, but I then have to manually include them in the project. Why is this, and how do I get araound it?
How about using the Feature Builder Power Tool? http://visualstudiogallery.msdn.microsoft.com/67b720f4-9a50-41cb-86a2-82e33b7c5fc4/
It should give you all the freedom to create whatever logic you want during solution setup...
So I couldn't find a workaround for this issue.
What I have managed to do though is make a decent enough template that should be run once, with all references (being relative) pointing to an outside lib folder.
This means I can use the template on a new machine, copy some dlls to a new lib folder, and then work away from there. Not an ideal solution, but it works...
My team is creating some standard VS solution templates. We have a well-defined project structure, resources, etc. that we need to use every time we start a new project and this is the perfect solution. The basics work nicely.
However, as well as defining folder structure (etc.) it would be nice to be able to import a number of projects from VSS/TFS. We have a number of shared assemblies that will be used by all projects and it would be awesome to add a reference to these projects when creating a new project via our template. Can anyone tell me if this is possible and, if so, how it can be achieved?
I think there are 3 types of items you might want to templatize (is that a word?).
New Solution
New Project added to a solution
New item added to a project
I'm not sure whether its possible to add existing projects to the solution that is created when a project template is run. http://msdn.microsoft.com/en-us/library/ms185308.aspx shows how to create multiple project templates. You may have to either manually add them to the solution or create a script that modifies the .sln file to do that part.
Adding an assembly reference to either a project or item template is easily doable. The project template is pretty simple since you just need to modify your .vstemplate file for the project template(s). See http://msdn.microsoft.com/en-us/library/ms171405.aspx for reference.
Adding a new assembly reference when you add a new item from a template is a bit harder but can also be done. See http://msdn.microsoft.com/en-us/library/ms185290.aspx for more.
Have fun!
I have been using the Codesmith framework NetTiers to generate a DAL etc., into a folder called, say, 'NetTiers', outside my main project's folder, and referencing the DLLs within that folder from my main project.
I've started using the Plinqo framework, and want to use the generated files from that framework within the same project as the one I'm using with NetTiers. (The reason I'm using both frameworks is that I want to get/learn the newer LINQ goodness from Plinqo, yet also have the familiar NetTiers code DAL, BLL syntax available, for compatibility.)
My question is: what's the best Visual Studio solution and file structure to use when using Codesmith templates like these? Should the frameworks' generated code be contained outside the main project and added as projects to the overall solution? Or should each template's generated code have its own solution? Should the generated files be within the main project's file structure?
I've tried combinations of each of these, and they each have their pros and cons. I'd like to know if there's a tried and tested pattern.
When it comes to .netTiers, I always compile the generated solution and add the assemblies as references to my project. This makes it much easier to upgrade/diff and regen.
However, there are going to be some cases where you would want to add your custom logic so keep this in mind.
Thanks
-Blake Niemyjski
I tend to just keep the .csp and the generated folder outside of my main app's folder. When adding a reference Visual Studio copies in the .DLLs from the built generated code. All of the generated projects sit under a main folder such as D:\CodeSmith Projects\
If you want to version control the .csp file it might be beneficial to move it in with the rest of your version controlled app files to tie it all together.
We put the generated projects inside our solution. In fact on my current project I generated the nettiers files to the location that I wanted the files to be, and Started adding my own project files to that...But we have always kept the files in the solution, that way if i need to add something to the code in the concrete classes I can do it without having to open a whole new project.
We have tried both scenarios. We settled for including the assemblies in a dependencies folder, which was shared by multiple projects.
We had problems with TFS when the projects were included in the solution. the downside, is that you can't so easily step into the .NetTiers generated code when debugging, though after a while you get used to this, and accept that whatever is in .NetTiers stays within .NetTiers!