How do I fix 'Schema validation error' when trying to build project?
Asked Answered
M

4

5

I'm trying to use the TextMate extension for Visual Studio to create custom highlighting, but when I try to build it I get the following error and I have no idea what it means even after trying to look for a solution. I have seen few people have same issue but have not found solution. This seems to happen on a fresh project, so there probably is some error in the template, but I can't find where it is.

Schema validation error for '..\obj\Debug\extension.vsixmanifest'. The http://schemas.microsoft.com/developer/vsx-schema/2011:Assets element is not declared.

How do I fix this error?

Marsala answered 3/7, 2021 at 7:38 Comment(0)
E
2

I did some tests, and I met the same issue. If I edited and changed the Identifier and Version Range, I found that the project could be built.

For example, create a new Textmate Grammar Extension project and then the default source.extension.vsixmanifest file > Install Targets > Identifier and Version Range will be like following screenshot:

default

And the default values are

“Microsoft.VisualStudio.Community [15.0, 17.0)” “Microsoft.VisualStudio.Community [17.0, 18.0)”

I changed them to

changed

“Microsoft.VisualStudio.Community [15.0, 17.0)” or “Microsoft.VisualStudio.Community [15.0]” and then Rebuild the project, it could be built. You can have a try.

Besides, I’m not sure if there are some conflicts, or maybe it’s a potential issue, I suggest you report this issue here: Textmate Grammar Template – Q&A, or Developer Community (from VS > Help > Send Feedback > Report a Problem)

Eyeshade answered 5/7, 2021 at 6:6 Comment(0)
R
4

We got these exceptions:

    1>VSSDK : error VSSDK1062: Schema validation error for 'C:\...\obj\Debug\extension.vsixmanifest'. The 'http://schemas.microsoft.com/developer/vsx-schema/2011:Dependencies' element is not declared.
    1>VSSDK : error VSSDK1062: Schema validation error for 'C:\...\obj\Debug\extension.vsixmanifest'. The 'http://schemas.microsoft.com/developer/vsx-schema/2011:Assets' element is not declared.

To fix this we had to comment out the Dependencies and Assets sections in the vsixmanifest file:

    <!-- <Dependencies> -->
    <!--     <Dependency d:Source="Manual" Id="Microsoft.Framework.NDP" DisplayName="Microsoft.NET Framework" Version="[4.5,)" /> -->
    <!-- </Dependencies> -->
    <!-- <Assets> -->
    <!--     <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" /> -->
    <!-- </Assets> -->

The build and the extension itself work now, however we don't know exactly what was the root of the problem...

Reidreidar answered 20/10, 2021 at 6:15 Comment(0)
E
2

I did some tests, and I met the same issue. If I edited and changed the Identifier and Version Range, I found that the project could be built.

For example, create a new Textmate Grammar Extension project and then the default source.extension.vsixmanifest file > Install Targets > Identifier and Version Range will be like following screenshot:

default

And the default values are

“Microsoft.VisualStudio.Community [15.0, 17.0)” “Microsoft.VisualStudio.Community [17.0, 18.0)”

I changed them to

changed

“Microsoft.VisualStudio.Community [15.0, 17.0)” or “Microsoft.VisualStudio.Community [15.0]” and then Rebuild the project, it could be built. You can have a try.

Besides, I’m not sure if there are some conflicts, or maybe it’s a potential issue, I suggest you report this issue here: Textmate Grammar Template – Q&A, or Developer Community (from VS > Help > Send Feedback > Report a Problem)

Eyeshade answered 5/7, 2021 at 6:6 Comment(0)
O
1

I just had a similar error when updating an extension for VS2022.

1>VSSDK : error VSSDK1062: Schema validation error for 'PATH\obj\Debug\extension.vsixmanifest'. The 'http://schemas.microsoft.com/developer/vsx-schema/2011:Dependencies' element is not declared.
1>VSSDK : error VSSDK1062: Schema validation error for 'PATH\obj\Debug\extension.vsixmanifest'. The 'http://schemas.microsoft.com/developer/vsx-schema/2011:Assets' element is not declared.

The problem in my case was that I'd made a mess of the InstallationTarget node in source.extension.vsixmanifest, which is something that currently needs hand-editing:

    <Installation>
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
            <ProductArchitucture>amd64</ProductArchitucture>
        </InstallationTarget>
    </Installation>

(This was easy to spot using the Visual Studio text editor: right click source.extension.vsixmanifest in the Solution Explorer, do a View Code, and look for any squiggles or underlines.)

Once I'd fixed the spelling error, the build started to work correctly.

Ocrea answered 15/10, 2022 at 16:7 Comment(1)
Sorry Tom, I didn't understand what the syntax error was, but my squiggle said that Installation target couldn't contain other tags, so I deleted the ProductArchitucture tag which might come back to bite me later!Salep
S
1

For me, I just moved this section down as the last section that did the trick.

<Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
        <ProductArchitucture>amd64</ProductArchitucture>
    </InstallationTarget>
</Installation>
Statutory answered 28/9, 2023 at 20:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.