What does "Unauthorized zone" mean when browsing xsd files with Visual Studio 2010?

10,797

Solution 1

For me it worked after going to the properties of the XSD file and clicking on Unblock. i got this answer from How do I modify my settings to allow VS2010 to load 3rd party XSD files from the "Unauthorized Zone"?

Solution 2

Visual Studio caches XSD schemas at %VsInstallDir%\xml\Schemas with Target Namespace attribute (url of schema file) when you add them to your editor.

Blog post says that
The inclusion of Local.xsd in the “Unauthorized Zone” and the warnings in the error pane about not being able to resolve the schema location are an indication to the end user that the schema they were visiting attempted to bring in a schema from a zone that it is not authorized to access.

Reason the IO Permission error shows itself is your machine has no authority to download external xsd file(s) from the location.So there is no cache that Visual Studio might validate your other xsd files.

You should check your networking options so you may download those xsd files.While you can it means you have access to that location,so Visual Studio can cache them.If you're sure that you have access,you may also download those xsd files and put them Visual Studio's default schema location and indeed add them in editor.

Also check about cache here

Hope this helps
Myra

Share:
10,797
starskythehutch
Author by

starskythehutch

Updated on June 15, 2022

Comments

  • starskythehutch
    starskythehutch almost 2 years

    When I open up an xsd file that includes other xsd files, all of the included files are added to a section called "Unauthorized zone". Visual Studio highlights the xs:include element and gives the following error when trying to resolve the schemaLocation attribute:

    Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    I've read the following blog post, but I'm not familiar enough with xsd yet to fully understand it.

    Can anyone explain why this is happening or point me to a good resource that can help?

    [Edit] All of the xsd files that are to be included are in the Visual Studio project.

  • starskythehutch
    starskythehutch almost 14 years
    Thank you for answering. I was under the impression that that folder was for xsd files for consumption by Visual Studio. This line would seem to suggest that: Because the schema cache directory is global to your computer, you should only add schemas here that are standard and useful to all the Visual Studio projects that may be created on your computer. Is this not correct?
  • Myra
    Myra almost 14 years
    Correct,You can add local or external schemas as long as you have xsd files.
  • starskythehutch
    starskythehutch almost 14 years
    Thank you Myra. I used your information in conjunction with this link msdn.microsoft.com/en-us/library/ms255816.aspx and succeeded.
  • InfantPro'Aravind'
    InfantPro'Aravind' over 12 years
    Cache folder was the victim, @Myra, thanks for the link :) thumbs-up
  • Alexander Gräf
    Alexander Gräf almost 2 years
    That is one obscure thing, and even in VS 2022 it is still a problem - as in: it doesn't show a proper error message, just very confusing tool tips. I only found the problem after seeing VS accessing the "Zone.Identifier" NTFS stream and then remembering that I downloaded the XSDs from the W3C website.