Configure default schema for SCOM management pack fragments in Visual Studio / VSAE



If you’ve ever used Visual Studio with the Visual Studio Authoring Extensions (VSAE) for authoring a management pack for SCOM you have likely run into the annoying problem where VS forgets how to identify the schema for SCOM stuff which causes Intellisense to fail. I can’t explain why it sometimes will or won’t auto load schemas but here are some ways to fix it.

When the schema fails to load, you don’t get any options in your Intellisense dropdown.


You can add the schema manually for every fragment, which is cumbersome.


Select the FullFragmentSchema.xsd within the SystemCenter folder shown. If it doesn’t exist in the schema list, add it.

The other option is to add an association to the “.mpproj” file type within the schema catalog as shown below. The example below uses the path to my 2022 VS installation. Modify your path as needed.

  <!-- supports SCOM MPs -->
  <Schema href="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Xml\Schemas\SystemCenter\FullFragmentSchema.xsd" targetNamespace="http://schemas.microsoft.com/maml/2004/10"     />
  <Association extension="mpproj" schema="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Xml\Schemas\SystemCenter\FullFragmentSchema.xsd" defaultNamespace="http://schemas.microsoft.com/maml/2004/10" enableValidation="false"/>

If your solution is open, close it. Upon opening your solution, you should see Intellisense behave correctly for your fragments.

Make sure you have a target framework version property in your .mpproj file or VS 2022 will likely complain upon loading the solution.

  <PropertyGroup Label="Globals">
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
  </PropertyGroup>
  

Leave a Reply

Your email address will not be published. Required fields are marked *