Thanks. I put the .xsd file into "C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas". And it works.
> Did you return the schema from your extension's Schema > property? How to create an instance of extension's Schema ? I found method LoadXmlSchemaHelper. Is it good in this method? this.schema = LoadXmlSchemaHelper( Assembly.GetExecutingAssembly(), "Microsoft.Tools.WindowsInstallerXml.Extensions.Xsd.xxx.xsd" ); How to decide and give a resource name this method ? Where should be defined these resorce name that specified the follow methods ? - LoadTableDefinitionHelper, - LoadLibraryHelper, Thianks. > -----Original Message----- > From: Rob Mensching [mailto:r...@robmensching.com] > Sent: Wednesday, January 06, 2010 12:19 PM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] How to create extension and a new schema ? > > Did you return the schema from your extension's Schema > property? You might check out the source code for the other > extensions in wix at src\ext\*\wixext. > > On Tue, Jan 5, 2010 at 6:16 PM, > <akihiro.shib...@jp.yokogawa.com> wrote: > > > HI, > > > > I develop a new extension. And I written a new schema in xsd file. > > I create a new setup project on Visual Studio, But it show display > > message that "Id" attribute cannot found on the message view of > > Visual Studio . > > > > How to import a new schema file and use on Visual Studio? > > something wrong ? > > > > > > > > 1) xsd file like this: > > > > > ---------------------------------------------------------------------- > > > ---------------------------------------------------------------------- > > ------------------- <?xml version="1.0" encoding="utf-8"?> > <xs:schema > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:xse=" > > http://schemas.microsoft.com/wix/2005/XmlSchemaExtension" > > xmlns:html="http://www.w3.org/1999/xhtml" > > targetNamespace="http://schema.www.xxxx.com/wix/2009"> > > <xs:annotation> > > <xs:documentation> > > </xs:documentation> > > </xs:annotation> > > <xs:element name="AppendUserGroup "> > > <xs:annotation> > > <xs:documentation> > > </xs:documentation> > > <xs:appinfo> > > <xse:parent namespace=" > > http://schemas.microsoft.com/wix/2006/wi" ref="Component" /> > > <xse:remarks> > > </xse:remarks> > > </xs:appinfo> > > </xs:annotation> > > > > <xs:complexType> > > <xs:attribute name="Id" type="xs:string" use="required" > > > <xs:annotation> > > <xs:documentation> > > </xs:documentation> > > </xs:annotation> > > </xs:attribute> > > </xs:complexType> > > </xs:element> > > </xs:schema> > > > > > ---------------------------------------------------------------------- > > > ---------------------------------------------------------------------- > > ------------------- > > > > 2) extending the CompilerExntension and overriding a parse method. > > > > public override void ParseElement(SourceLineNumberCollection > > sourceLineNumbers, XmlElement parentElement, XmlElement element, > > params string[] contextValues) > > { > > switch (parentElement.LocalName) > > { > > case "Component": > > string fileId = contextValues[0]; > > switch (element.LocalName) > > { > > case "AppendUserGroup ": > > > this.ParseAppendUserGroupElement(element, > > fileId); > > break; > > default: > > > this.Core.UnexpectedElement(parentElement, > > element); > > break; > > } > > break; > > default: > > > this.Core.UnexpectedElement(parentElement, element); > > break; > > } > > } > > > > 3) insert AssemblyDefaultWixEtension into AsseblyInfo.cs > > > > 4) a new setup project > > > > > ---------------------------------------------------------------------- > > > ---------------------------------------------------------------------- > > ------------------- <Wix > > xmlns="http://schema.microsoft.com/wix/2006/wi" > > xmlns:myutil="http://schema.www.xxxx.com/wix/2009"> > > : > > <Compornent Id="COMPONENT1" > > > <myutil:AppendUserGroup Id="NewGroupName" /> </Component> > > : > > </Wix> > > > > > ---------------------------------------------------------------------- > > > ---------------------------------------------------------------------- > > ------------------- > > > > Thanks, > > > > Akihiro Shibuta. > > > > > > > > > > > > > > > ---------------------------------------------------------------------- > > -------- This SF.Net email is sponsored by the Verizon Developer > > Community Take advantage of Verizon's best-in-class app development > > support A streamlined, 14 day to market process makes app > distribution > > fast and easy Join now and get one step closer to millions > of Verizon > > customers http://p.sf.net/sfu/verizon-dev2dev > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > > -- > virtually, Rob Mensching - http://RobMensching.com LLC > -------------------------------------------------------------- > ---------------- > This SF.Net email is sponsored by the Verizon Developer > Community Take advantage of Verizon's best-in-class app > development support A streamlined, 14 day to market process > makes app distribution fast and easy Join now and get one > step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users