microsoft / VSProjectSystem

Documentation for extending Visual Studio with new types of projects.
Other
313 stars 87 forks source link

Project System Extensibility extension for VS2022 #350

Open ahoemb opened 2 years ago

ahoemb commented 2 years ago

Any plans to release this?

johnwc commented 2 years ago

@drewnoakes Seems current extension only works for VS2017, any update when it will be updated for 2019 or 2022?

drewnoakes commented 2 years ago

Are you referring to the sample code here?

johnwc commented 2 years ago

I'm referring to the third requirement in the prequisites, the Visual Studio Project System Extensibility Preview.

drewnoakes commented 2 years ago

Thanks. For what it's worth, I never installed that and am able to develop with CPS in VS2022.

Make sure you have the VS Extensibility workload installed via the VS installer:

image

Beyond that, I'm not aware of any other special requirements. Is there something that extension gave you that you miss?

johnwc commented 1 year ago

I will check to see if I have that checked and installed. I believe I was looking for the additional project types that the mentioned add-on adds to VS. Trying to create a CodeGenerator that can read the project's properties set on a file. And a VS UI add-on that I can use to set those properties on the selected file.

We have an OpenAPI yaml schema file in a project. Needing to create a UI/VS Options on the file to set properties like language of code to produce, along with other options the code generator supports. These options would be placed in the project file under the file, like shown below. Then when the code generator is run for the file, it can read these options to know the configuration to run for the generator.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  ...
  <ItemGroup>
    <None Update="Zoho\API\ZohoOAuthSDK.yaml">
      <CustomToolNamespace>Company.CRM.Zoho.API.oAuth</CustomToolNamespace>
      <Generator>OpenApiCodeGenerator</Generator>
      <OpenApiLanguage>CSharp</OpenApiLanguage>
      <OpenApiOption...>???</OpenApiOption...>
      <OpenApiOption...>???</OpenApiOption...>
      <LastGenOutput>ZohoOAuthSDK.cs</LastGenOutput>
    </None>
  </ItemGroup>
</Project>
reyemtocs commented 1 year ago

+1 I want to create a new project type and was following this https://github.com/microsoft/VSProjectSystem/blob/master/doc/overview/define_a_new_project_type.md

All I need is a project type to mimic everything that C# does. Basically a new Project Guid. I was trying to do this from a VSIX and that was muddied up by VSPS, MPF or https://github.com/dotnet/project-system documentation. It just isn't clear to me how to create a new Project Type in VS 2022. Are we suppose to lean to VSPS Extensibility? If so the documentation mentioned above doesn't work for VS2022. I would love to help in document, but its not clear of where to start. Seems like the Project-system is where to start, but I only need the project itself. Everything else should inherit from the C# project. Isn't that what VSProjectSystem was supposed to address without the difficulties of a full blown MPFProj?

Any help would be appreciated.

softworkz commented 11 months ago

I've just posted a patched version of the VS Extensibility Extension for VS 2022: https://github.com/microsoft/VSProjectSystem/issues/371