Giter VIP home page Giter VIP logo

vsprojectsystem's Introduction

Visual Studio Project System Extensibility Documentation

What is a project system?

A project system sits between a project file on disk (for example, .csproj and .vbproj) and various Visual Studio features including, but not limited to, Solution Explorer, designers, the debugger, language services, build and deployment. Almost all interaction that occurs with files contained in a project file, happens through the project system.

There are three reasons to extend a project system in Visual Studio:

  1. Support a new project file format.
  2. Integrate existing file format with a new language service.
  3. Customize behavior of an existing project system.

Project system extensibility

The traditional way to a build or customize a project system is to implement a set of Project System COM interfaces. Most project systems don't start from scratch. Instead, they leverage the MPFProj project system example as a starting point.

The Visual Studio Project System (VSPS) described in this repository provides default implementation for a subset of project system COM interfaces. This simplifies building and maintaining a project system, but comes with the cost of reduced functionality.

How to select a project system platform?

Scenario Recommended Project System Platform
Customize C#/VB/F# Desktop project system COM-based project flavoring.
Customize C#/VB/F# .NET Core project system Not fully supported at this time. VSPS is your best bet.
Add new a project type or a language Prototype with VSPS, but be ready to fall back to MPFProj for complex scenarios that VSPS doesn't support yet.

Compare MPFProj and Visual Studio Project System

Criteria MPFProj Visual Studio Project System (this repo)
Maturity Release Preview
Breaking changes in major updates None [Expected][changes]
Flexibility Full control over project system behavior. Some project system interfaces are not implemented.
Complexity High: You will need to understand all project interfaces. Low: You only need to understand customized behavior.
Extensibility Implements project system COM interfaces. C# with managed interfaces for extension points and MEF.
Threading model Single threaded and bound to the UI thread. Multi-threaded, scalable, and responsive.
Scalability Memory-optimized Uses extra memory to support multi-threading.
Methodology Provides templates that implement project interfaces. The project system can modify or add to these templates. Locks down project system interfaces and allows to override some behaviors.
Used by project systems Desktop C#/VB/F# .NET Core C#/VB/F# and C++
Minimum Supported Version Visual Studio 2008 Visual Studio 2015 (some APIs are not available in older versions and there are [breaking changes][changes] in major versions)

Visual Studio Project System

Visual Studio can be extended in many ways, including adding new types of projects and augmenting existing ones. This repository contains the documentation and best practices for creating extensions that add new project types to Visual Studio. We welcome community input if you wish to contribute new topics or find any issues.

To get started, read the introduction while you're waiting for the pre-requisites to install.

Please file any product bugs you find on Developer Community. You may file doc bugs here.

Join the chat at https://gitter.im/Microsoft/extendvs

For further information about extending Visual Studio in other ways please check out Visual Studio extensibility documentation.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

vsprojectsystem's People

Contributors

aarnott avatar adrianvmsft avatar bertique avatar changsi-an avatar chwarr avatar davidwengier avatar davjs avatar davkean avatar drewnoakes avatar enricosada avatar gitter-badger avatar gusper avatar hmemcpy avatar jviau avatar kirillosenkov avatar kristianjakubik avatar kzu avatar lifengl avatar markpflug avatar microsoft-github-policy-service[bot] avatar pajdzik avatar srivatsn avatar stan-sz avatar tmat avatar tmeschter avatar vijayrkn avatar viktorveis avatar willbuik avatar workgroupengineering avatar yuliiakovalova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsprojectsystem's Issues

XamlPropertyRule generated namespaces should match folder structure

In C# embedded resources tend to take on a namespace based on the RootNamespace project property, concatenated with the folder structure within which the resource is found in the project source tree.

XamlPropertyRule is configured by default to drop all generated code into RootNamespace directly. We should fix this to match other C# behavior.

IVsTrackProjectDocumentsEvents2.OnAfterRenameFiles is not called in projects based on CPS on directory rename/move.

Hi,

I'm trying to migrate my extension to Visual Studio 2015 RC and can't get IVsTrackProjectDocumentsEvents2.OnAfterRenameFiles working for folder rename/move actions in projects based on CPS(tried on ASP.NET vNext and JavaScript). Could you please confirm that it's a bug(in CPS itself or in its implementation in ASP.NET vNext, JavaScript) and will be fixed in RTM or
it's expected behavior of new project system and will remain in RTM?

Thanks.

Regards,
Nikita Govorov.

How to Hide PowerShell Related Items in Project Type Project

When creating a CPS Project Type project and running in VS hive, there is a PowerShell installed template and a few related item templates to select. This is also the same when right-clicking the project to add new item.

Is there a way to hide the PowerShell items in your Project Type project? If so, any docs/steps to do so?

Thanks

Colorize all code snippets

We have a lot of code snippets in the docs. We should change them all to use the ```csharp syntax so that they are colorized.

[Question] Get Full C# Intellisense in new project system

I've been trying to create a new Project System that still uses C# source files. I've had a persistent issue where Intellisense only sees types defined in referenced assemblies that are in the Framework folder of the "Add Reference" dialog. My projects are requiring .NET 3.5 if that makes a difference.

(These is for making it easier to make mods for Kerbal Space Program.)

Documentation request: How do I add support for a new language?

At a high level, it's a really simple question. If I create a hypothetical language called B♭, and provide a B♭ compiler, what is the step-by-step list of things I need to do to get Visual Studio to create, load, and build a B♭ project? But trying to find answers cam be maddening!

It would be very nice if there was a tutorial that explained all of the necessary steps (and the "not strictly necessary but this would be helpful if you implemented it" steps, and clearly denoted which is which kind) to add support for a new language. Even nicer if it can be made to appear at or near the top of relevant Google searches, but one thing at a time, I suppose...

Disabling build

I'm working on a Exe project kind of project system, and I need Build disabled, but I do need debug targets, debug, configurations, per configuration property pages, and property pages working.

The shell can do some of this by checking the ADDVP_ExcludeFromBuild, but that only works for virtual projects, and virtual projects do not work with project factories. The other way is by querying IVsBuildableProjectCfg set of interfaces, and CPS has a way of disabling some of this thru the conditions on BuildableProjectConfig, which it disables if a project has the SharedAssetsProject capability. Adding this capability to my project disables the build, but also takes away debug and debug targets. Is there a way to make this not take away debug targets?

ProjectType fails build when set to Class Library

I'm not sure where to raise issues for this SDK as its an odd hybrid of closed source code and open source docs. But here goes in the hope it has the desired effect,

If there is a better place to raise issues for the code rather than the Docs perhaps you could point me to the documentation of that place.

To reproduce the above:
Create a new "Project Type" project.
Change nothing.
Press F5 to execute.
In the experimental instance create a new project of the new type.
Build the new project - all is well.
Change the project "Output Type" preperty to "Class Library"
Build the new project - error CSC : error CS2019: Invalid target type for /target: must specify 'exe', 'winexe', 'library', or 'module'

App designer support ?

The intro page under "Limitations" mentions :
No (or very limited) app designer support. Project properties are typically accessed via the Property Pages dialog instead.

Could you please elaborate a bit more on what this means ? Does this limitation only apply to the design surface for "Projects" and not the files contained within it ?

I'm currently implementing an extension that provides a XAML based UI for editing a custom file type. These file types will eventually be part of my project system. See this as an example of what I'm trying to build:
https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/WPFDesigner_XML

Will a CPS based project system not be compatible with extensions built using the regular VS SDK APIs ? Or is my scenario supported ?

Thanks.

Analyzers not using proper package layout

So, there is now a convention for where to put analyzers in a NuGet package, and it's important to follow this convention if you want them to work properly with anything other than the old packages.config format, since that's the only situation in which install.ps1 and uninstall.ps1 will ever run: neither Paket nor NuGet v3 in project.json mode will pick up analyzers that aren't located according to the convention.

The convention is basically to put analyzers in an analyzers/dotnet directory within their package, and to further split any language-specific analyzer DLLs into cs and vb subdirectories under that. (Or you could follow the links above for the details, most of which are fairly irrelevant so far.)

Btw, this concerns the packages:

  • Microsoft.VisualStudio.ProjectSystem.Analyzers (14.0.50729-pre)
  • Microsoft.VisualStudio.Threading.Analyzers (14.1.114-pre)

(Not sure the latter is strictly-speaking yours, but the package doesn't exactly point at a bug tracker and your "Project Type" template pulls it in, so I might as well list it while I'm here ...)

Problem with IDynamicEnumValuesProvider not picked up in VS2015

I tried to follow the VS2013 to VS2015 porting instruction for dynamic-enum-provider and failed.

Isn't there anything extra required or this feature doesn't work in VS2015 RC yet?

My package is MEF-enabled. I apply ExportDynamicEnumValuesProvider to class implementing IDynamicEnumValuesProvider interface and nothing actually happens (when project with such a rule is loaded). However the same class works fine in VS2013 using Export and DynamicEnumCategory.

Project and provider implemenation can be found here.

Thanks

IDynamicEnumValuesProvider should be documented

We should include a sample use of the ExportDynamicEnumValuesProviderAttribute and how to activate the extension from the XAML rule file, including passing in parameters using <DynamicEnumProperty.ProviderSettings>

Display Name for Installed Template

What do you modify in the Project Type project to display within the New Project > Installed Templates? This would be compared to the Visual C# template. As an example, what if I wanted a multiple word project type (called My Boo)? So what file and item do you modify to display New Project > Installed Templates > My Boo?

Consistent Project Capitalization

The capitalization for the various item templates are not consistent. As an example, there is one for Custom Debugger Extension and one for Project Deploy extension. The capitalization for word 'extension' is different.

[Question] Attach Debugger

I am fairly new to VS extension development, I have written a DDEX provider for VS, but that is about it.

I am looking for guidance for the following idea.

I would like a project based upon an ASP.NET WebForms project but with the following tweaks:

  1. I want to control the item types avaiable when you click add new item
  2. I want to control what happens when you click "Run" to run the project.

Number 2 is where I am struggling. I need to try and find the appropriate extensivity point so that when the project is "Run" the following happens:

  1. Do the normal build --> my msbuild targets will produce a deployment package for the project (this is essentially a NuGet package)
  2. The output of the project is "deployed" to a locally running "host" application.
  3. The standard VS debugger is then "Attached" to that locally running host process.

So really, the project is essentially an ASP.NET WebForms project that produces a custom output package when it is built, and when it is run, I want to start my own host process, deploy to that process, and then "Attach"

If anyone can point me in the right direction - in terms of approaches / extensivity points I would need to implement - I would be very greatful! Starting whether this should be a Project "Flavour" or a full blown new Project type..

Replace "CPS" references

We should refer to CPS in the docs consistently with its new moniker of "Visual Studio project system" or "project system extensibility SDK".

MSBUILD conditions on ProjectCapabilities

I'm trying to disable the Reference folder in a project system that needs it both on or off depending on the value of a MSBUILD property, the capability is declared as such:

<ProjectCapability Condition="'$(DisableReferencesFolder)' != 'true'" Include="ReferencesFolder" />

That does not work, it seems that CPS does not evaluate the conditon, I also tried:

<ProjectCapability Include="ReferencesFolder" />

and later on:

<ProjectCapability Include="!ReferencesFolder" />

But that doesn't work either. Am I missing something, or is my syntax bad? Otherwise, is there a way to do it programmatically using the CPS OM?

Project items with Folder item type can not have browsable properties

Currently if you click F4 (Properties) on a project's folder there will be no properties displayed even though I define xaml rule for Folder item type.

As we determined in the email thread it is not currently supported in CPS, but in csproj project folders do have their properties. So to have similar functionality we also would need to provide some properties for our folders.

ProjectType project gives "VSSDK1031: Extension error" on build after uninstalling the extension in the experimental instance

To reproduce:

  1. Create a new projecttype project
  2. Ensure the solution builds
  3. Launch the ProjectType project in the experimental instance (F5)
  4. Go to "Tools" -> "Extensions and updates" on the experimental instance
  5. Find the extension matching the created projecttype and uninstall it
  6. Close the experimental instance
  7. Right click on the solution and select "rebuild"
1>------ Rebuild All started: Project: ProjectType3.ProjectTemplate, Configuration: Debug Any CPU ------
1>  ProjectType3.ProjectTemplate -> D:\dev\csharp\DevArch\ProjectType3\ProjectType3\ProjectType3.ProjectTemplate\bin\Debug\ProjectTemplates\ProjectType3\1033\ProjectType3.zip
1>  ProjectType3.ProjectTemplate -> 
2>------ Rebuild All started: Project: ProjectType3.ProjectType, Configuration: Debug Any CPU ------
2>  ProjectType3.ProjectType -> 
2>  ProjectType3.ProjectType -> 
2>  ProjectType3.ProjectType -> D:\dev\csharp\DevArch\ProjectType3\ProjectType3\ProjectType3.ProjectType\bin\Debug\ProjectType3.dll
2>  Creating intermediate PkgDef file.
2>  Creating VSIX Container...
2>  ProjectType3.ProjectType -> D:\dev\csharp\DevArch\ProjectType3\ProjectType3\ProjectType3.ProjectType\bin\Debug\ProjectType3.vsix
2>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\VSSDK\Microsoft.VsSDK.targets(653,5): error VSSDK1031: Extension 'ProjectType3.ProjectType..46f10d4a-3105-49a3-8cec-0d401288da4f' could not be found. Please make sure the extension has been installed.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

This also occurs if the two projects are wrapped in another vsix container.

Provide a reference implementation

First, thank you for making this information finally public! I've been trying to implement my own project system based on CPS with partial success, and this documentation is extremely helpful!

It would be awesome if you could make available a complete implementation of a project system to serve as reference. I propose the NuGet project system by @terrajobst, and if at all possible, aspnet vNext!

Project types should not require MSI to deploy build authoring

First of all, thank you for VSProjectSystem!

When I build it automatically copies the project's props, targets and rules to "%localappdata%/CustomProjectSystems/ProjectType1". The project file in the project template refers to that folder. So far, so good, everything works fine in exp instance.

The .vsix that gets created when I build doesn't have any of those build system files included. That's bad news :(

Will .vsix be extended to support deployment to "%localappdata%/CustomProjectSystems" ? There are some nice advantages to deploying as a .vsix, it would be nice to one day be able to use it! As a custom project type, deployment of msbuild files is the main thing that forces you to use .msi. I hope I'm wrong though :)

Invalid Link in add_a_source_item_with_specific_item_type.md

Invalid links in the document https://github.com/Microsoft/VSProjectSystem/blob/master/doc/automation/add_a_source_item_with_specific_item_type.md

These defaults can be augmented.

2.Automatically add the item to Solution Explorer, DTE, and raise other appropriate events if indeed the item you're adding has an item type that belongs to the set of source item types.

Showing link for https://github.com/Microsoft/VSProjectSystem/blob/master/doc/automation/custom_item_types.md

Uploading a Project Type to Visual Studio Gallery

With my current basic knowledge about the Project Type, it appears this project is a form of project that can be added to a VSIX. Is it possible today (or planned later) to upload these types of projects to the Visual Studio? What would you need to do? Create a VSIX project in VS and add the project type project? Is there any documentation to do this today or is it in the roadmap? TIA

Adding Item Templates for Specific Folders in Project

Let's say I have a few folders added with a new Project Type project. As an example, it includes One, Two and Three. Is there a way to only show specific types of items templates to be added within a specific folder? A further detailed example... let's say the user right-clicked the One folder > Add > New Item... Within the Add New Item dialog, there would be specific templates that could be added (e.g. One.cs). And if the user did the same for Two folder, it would show a different list of items that could be added (e.g. Two.py). TIA

Open source CPS itself

If the source for the CPS were opened up, that would probably make it a lot easier to understand. And who knows, it might even lead to some improvements being contributed.

Roadmap

Are there any plans to provide a roadmap for this project? I believe this is a really good start, but it seems there would be more transparency on related topics since this is the future extension foundation. Below are a few examples I could quickly think of (in no particular order).

  1. Milestones - What features are planned with each release (preview to RTM flavors).
  2. Source code - It was acknowledged the project source would (hopefully) be released.
  3. What types of breaking changes are expected in VS vNext? Of course this is probably an unknown based on updates as the project progresses. However, it would be nice to see a list added over time to know what will be required to fix on our side of things.
  4. Examples, examples, examples.
  5. Thoughts of new extension capabilities possibly coming in VS vNext.
  6. Basic insight to team and resources allocated to project.
  7. I hope to see a future session (Channel 9, Build, etc.) that shows off some more of the goodness this project offers.

I understand this is extra work for the team to include during regular work, but would be very helpful. Thanks again and look forward to future releases :)

VC++ state/plans/documentation

VC++ is only mentioned briefly in "How to detect whether a project is a CPS project":

The following code snippet demonstrates how to detect whether a given project is a "pure" CPS-based project system (e.g. JavaScript, and not VC++ which is only half CPS).

So what does this "half CPS" mean?
And will there be an easier way to modify C++ projects or invoke the Ctrl+F7 "compile file functionality" than VCCLCompilerTool and all the hoops you have to jump through to even get there?

Adding Custom References Node with IProjectTreeProvider

The Custom Reference Types pages says that "You can define a References node by exporting IProjectTreeProvider . Implementations of this interface should derive from ProjectTreeProviderBase ."

I've found a couple aspects of this to be confusing:

  1. If I use [AppliesTo(MyUnconfiguredProject.UniqueCapability)] on the IProjectTreeProvider export, my implementation of ProjectTreeProviderBase doesn't get called. If I do [AppliesTo("")] instead, my code is called, but obviously is getting applied to more project types than I want. I am only trying to target a new project type that I am creating - is there any reason that [AppliesTo(MyUnconfiguredProject.UniqueCapability)] shouldn't produce the desired effect?

  2. As far as adding the actual node for the References Folder, I gathered that I should be using the NewTree() method of ProjectTreeProviderBase to create the new node, but if that's the case, I'm not seeing where/how to add this node to the existing tree. Any further clarifications on this?

Easy Way to Add Item Templates to Sub-Levels

What is the best method to add item templates to sub-levels of a Project Type? As an example, I want to have the following structure below when right-clicking my project > Add > New Item...:

Installed
----Boo
--------Scripts
------------Hoo
------------Casper

So when I click the Casper sub-level, it will show the different item templates included for Casper. How would you add the sub-level and its items? Any docs/links to help?

Reorganize doc files

We should at least consider:

  1. Organize docs in file system to resemble its structure in doc/Index.md.
  2. Switch to all lowercase filenames.
  3. Use shorter filenames rather than ones generated from long titles with hyphens.

Adding Custom Context Command for Solution Explorer Item

How would you add a custom context command for a specific file/folder in the Solution Explorer? As an example, let's say I right-click a file named (MyScript.py). I would like a custom command to only be shown if it was a specific file name (or possibly specific extension) in my project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.