none
How to share schema between projects. RRS feed

  • Question

  • I started receiving the error...

    "Cannot locate document specification because multiple schemas matched the message type"

    Researching this it seems that using the same schema in two different projects is a no-no.

    Can someone tell me how I can accomplish this? I have seen "add it to a common assembly", but I am still confused on the project type for the assemblies and how to referene the schema in my two projects.

    Thanks,
    Rod
    Tuesday, February 24, 2009 5:14 PM

Answers

  • Create a BizTalk project in VS2005 and just add your shared schemas. Build this project, you should end up with a dll.
    In any project where you wish to use thses schemas, Add Reference and select the dll created above.

    You need to deploy both dlls to Biztalk. If you deploy them to the same BizTalk Application then there is no problem. If you wish to have 2 BizTalk Applications using the same schemas, then you typically add your own shared Application, deploy the shared schema dlll here and in your othe BizTalk Applications reference the shared Application 
    Tuesday, February 24, 2009 6:21 PM
    Answerer

All replies

  • Create a BizTalk project in VS2005 and just add your shared schemas. Build this project, you should end up with a dll.
    In any project where you wish to use thses schemas, Add Reference and select the dll created above.

    You need to deploy both dlls to Biztalk. If you deploy them to the same BizTalk Application then there is no problem. If you wish to have 2 BizTalk Applications using the same schemas, then you typically add your own shared Application, deploy the shared schema dlll here and in your othe BizTalk Applications reference the shared Application 
    Tuesday, February 24, 2009 6:21 PM
    Answerer
  • I added the schema to a new project and complied the dll. I added the reference to my project and tried to update my message type on the receive message. In the drop down I select ".NET Classes - <Select from referenced assembly>. I select my common dll but don't see anything on the right side. I should see the schema here right? What am I missing?

    Thanks,
    Rod
    Tuesday, February 24, 2009 6:36 PM
  • You need to select "Schemas - <Select from referenced assembly>"
    Tuesday, February 24, 2009 7:02 PM
    Answerer
  • Sweet! Thanks.
    Tuesday, February 24, 2009 7:43 PM
  • Hi,

    I am exactly trying to do what is mentioned above..I have a couple of question with the following steps that you mentioned - "If you wish to have 2 BizTalk Applications using the same schemas, then you typically add your own shared Application, deploy the shared schema dlll here and in your othe BizTalk Applications reference the shared Application"

    So, Basically, I created another Biztalk project and put all my schemas there, and deploy the new app...Now How do I add a reference to this application in the two biztalk projects that i want to use the schemas in?

    Alternatively, I can create a new Application in Biztalk and Import the schemas dll as a resource, but then when I deploy my 2 projects that contain references to the schemas dll they would also copy the resource.

    Please help..All i want to do is to  deploy 2 biztalk projects that use the same schemas

    Thanks for your help

    Tuesday, January 26, 2010 10:39 PM
  • Gaurav,

    We have implemented same scenario our current project. Here is how we did it,

    ->Created a Biztalk project with common biztalk artifacts like schemas,maps,pipelines and even orchestration (which has common port types, multipart message types to be used by other Biztalk projects).

    ->During development time, we have added this common BT artifacts assembly as reference in all other BizTalk projects

    ->During deployment, we deploy the common project into separate BizTalk application followed by other applications. We do not have any run time dependency at BizTalk Application level in Admin console as the common artifacts are available in BizTalk management database and GAC.

    ->But whenever there are changes to Common artifacts assembly with same version, we either need to undeploy/delete all other applications in order to deploy common assembly.

    HTH,


    Please mark it as answer by clicking on "Propose As Answer", if it helps
    Tuesday, January 26, 2010 11:31 PM
  • Thanks a lot Rajesh..I got it totally..However my last question now...So how do i exclude the reference to my shared project dll while deployment..As we do our builds on a build server where the msi gets created and from there it is installed to other servers...So I can add a reference in my prject and get the schemas but how do i make sure that when I deploy the shared assembly does not go in the deployment.
    Wednesday, January 27, 2010 6:37 PM
  • We are currently manually building,deploying and exporting deployed application into MSI. In this case deployed application does not show referenced assemblies under references in Admin console. We are yet to automate delployment process.

    How are you currently creating MSI's through scripts..using some kind of Setup projects or MSBuild tasks?

    Can you try to build and deploy first and then export the deployed application through scripts?
    Please mark it as answer by clicking on "Propose As Answer", if it helps
    Wednesday, January 27, 2010 6:46 PM
  • What we do is from dev machines we check in our code and then on the build server, the code gets re-extracted and built on the build server..then it is deployed and an msi created on the build machine..This msi is then use to install to various environments.

    I think we can tweak the process a little bit that it stays the same on the build machine but when we create the msi on the build machine we do not include the shared schema..as it would already be deployed..does that sound reasonable ??
    Wednesday, January 27, 2010 6:57 PM
  • Hi Rajesh,

    I'm just going through the process of creating a shared project as you describe above however have created and deployed the shared project I'm now struggling to add a reference to the shared assembly.  It doesn't appear in the "Add Reference" > ".NET" tab so I can't add it. 

    How exactly did you add the reference?

    Thanks

    Wednesday, February 10, 2010 1:56 PM
  • goto [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders]

    Add new key "NKey" and under the string value (Default) add the name of the "path of directory" where ur dll is build.

    so now it il come to ur "Add Reference" > ".NET

     

    Thanks.

    Kunal G

    Thursday, June 17, 2010 9:36 AM