DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Validate XML Request Against XML Schema in Mule 4
  • Validate JSON Request Against JSON Schema in Mule 4
  • Schema Change Management Tools: A Practical Overview
  • Pagination in GraphQL: Efficiently Retrieve and Manipulate Data

Trending

  • Docker and Kubernetes Transforming Modern Deployment
  • Selecting the Right Automated Tests
  • Automated Testing: The Missing Piece of Your CI/CD Puzzle
  • Demystifying Enterprise Integration Patterns: Bridging the Gap Between Systems

How To Have Visual Studio Load XSD Schemas Automatically

Keith Elder user avatar by
Keith Elder
·
May. 08, 09 · News
Like (0)
Save
Tweet
Share
6.92K Views

Join the DZone community and get the full member experience.

Join For Free

At work we include XSD schemas in our Framework to allow developers to configure their web.config or app.config files and get Intellisense.   This helps to make sure they don’t make mistakes when they are configuring logging or other options for the framework (the same way the .Net Framework provides Intellisense for config files).  The problem is developers had to go to the XML menu of Visual Studio and add the schema by hand each time.  In other words, kind of a pain.  If you’ve never done this before it looks something like this:

Each time Visual Studio is opened or closed the schemas that are added have to be re-added.  I wanted to find a fix, not only for me, but the developers using our Framework as well. 

My first thought was to copy our framework schemas out to c:\program files\Microsoft Visual Studio 9.0\xml\Schemas.  But while I was looking around I found a catalog.xml file within that folder.  Interesting I thought.  I opened it up and went AHA here is the answer.

The file looks like this:

<SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog">
<Schema href="%InstallRoot%/Common7/IDE/Policy/Schemas/TDLSchema.xsd"
targetNamespace="http://www.microsoft.com/schema/EnterpriseTemplates/TDLSchema"/>
<Schema href="%InstallRoot%/Common7/IDE/Policy/Schemas/Policy.xsd"
targetNamespace="http://schemas.microsoft.com/VSPolicy/PDLSchema"/>
<Schema href="%InstallRoot%/xml/schemas/%LCID%/snippetformat.xsd"
targetNamespace="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"/>
<Schema href="%InstallRoot%/xml/schemas/%LCID%/vstemplate.xsd"
targetNamespace="http://schemas.microsoft.com/developer/vstemplate/2005"/>
<Schema href="%InstallRoot%/xml/schemas/%LCID%/Microsoft.Build.xsd"
targetNamespace="http://schemas.microsoft.com/developer/msbuild/2003"/>
<Schema href="%InstallRoot%/xml/schemas/%LCID%/vscontent.xsd"
targetNamespace="http://schemas.microsoft.com/developer/vscontent/2005"/>
<Schema href="%InstallRoot%/xml/schemas/%LCID%/customUI.xsd"
targetNamespace="http://schemas.microsoft.com/office/2006/01/customui" />
<Schema href="%InstallRoot%/common7/packages/SDM/Schema/SystemDefinitionModel.xsd"
targetNamespace="http://schemas.microsoft.com/SystemDefinitionModel/2005/1" />
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig20.xsd" condition="%TargetFrameworkVersion% = 2.0" />
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig30.xsd" condition="%TargetFrameworkVersion% = 3.0" />
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig30.xsd" condition="%TargetFrameworkVersion% = 3.0" />
</SchemaCatalog>

I copied one of the Association tags which has the extension=”config” attribute in it and made my own pointing to the location of our XSD file.  Having the ability to set the minimal version is nice as well.  I restarted Visual Studio and BAM, immediate Intellisense in my config file!

If you have been looking for a way to have XSD’s provide you Intellisense for your config files automatically, there you go.  Hope it helps.

 

Schema

Published at DZone with permission of Keith Elder. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Validate XML Request Against XML Schema in Mule 4
  • Validate JSON Request Against JSON Schema in Mule 4
  • Schema Change Management Tools: A Practical Overview
  • Pagination in GraphQL: Efficiently Retrieve and Manipulate Data

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: