views:

243

answers:

3

I use an external DTD to validate my xml files. Since the XmlReader seem to look for the DTD only in the folder where the xml file is, I need to somehow tell the reader to look into a specific folder where my dtd's are.

I though of XmlPreloadedResolver to solve this but I cannot find System.Xml.Utils.Dll in the GAC. Isn't this a standard .NET framework assembly?

EDIT: It seems this DLL relies on silverlight to be installed. Is there another way to use a dtd for validation which is in another folder than the xml file itself?

+1  A: 

According this article, System.Xml.Utils.dll is "optional and will be included in the package (XAP) based on the usage".

Seems this assembly is Silverlight related; on my machine, I just found it inside %ProgramFiles%\Microsoft SDKs\Silverlight\v?.0\Libraries\Client directories

Rubens Farias
So if I haven't silverlight I must always have my DTD files in the same folder where the xml files are?
codymanix
A: 

System.Xml.Utils.dll is not part of the standard .NET Framework. It is included as part of the Silverlight SDK. If you haven't already installed it, you can do so from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=1ea49236-0de7-41b1-81c8-a126ff39975b&displaylang=en

Once you have it installed, the assembly you want to reference in your project will be under %PROGRAMFILES%\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\

This assembly includes the class System.Xml.Resolvers.XmlPreloadedResolver

Saul Dolgin
A: 

.netfx 4.0 includes XmlPreloadedResolver in the System.Xml.dll. See http://msdn.microsoft.com/en-us/library/system.xml.resolvers.xmlpreloadedresolver.aspx for details.

Mollman