3

In a large VS 2008 solution we have different schema projects and mapping projects. The mapping projects reference the appropriate schema projects and this works fine overall.

However, recently I added a new schema project and it consistently gives the same problem. When I add a new schema to it, and I want to use that schema in a mapping project that already has a reference to the schema project, the map fails to validate with the message

Cannot load source/destination schema [...]. Either the file/type does not exist, or if a project dependency exists, the dependent project is not built.

Fair enough, I'll just re-build the schema project and this should solve the error. But that is not enough with this particular schema project. I have to remove and re-add the schema project reference to make this error go away. It's pretty annoying and it works for other projects without this extra step, so what can I do?

MarioDS
  • 12,895
  • 15
  • 65
  • 121

3 Answers3

3

What you are experiencing is a will known issue with the BizTalk Server 2009 Project system.

That version had a number of frustrating designer issues. The later Service Packs alleviated many of them but not all.

The most common workaround for the problem you are facing is to flip the Copy Local property of the Reference.

Johns-305
  • 10,908
  • 12
  • 21
  • Hi again fellow Biztalker :) yes it's true, there are **many** Visual studio related bugs with BizTalk 2009 and other stuff that are annoying for developers. – MarioDS Jul 03 '14 at 12:09
  • I'm getting this error in BizTalk 2013 R2 / Visual Studio 2013 as well. By flipping Copy Local do you mean True to False or False to True? @MDeSchaepmeester - Just want to confirm, did John's suggestion work for you? – FMFF Feb 11 '15 at 20:00
  • @FMFF I can't remember and also I've switched jobs some time ago so I can't really check. What I do remember is that I always had trouble with Visual Studio and BizTalk no matter what I did so I'd say it didn't really help. – MarioDS Feb 13 '15 at 20:27
1

I don't know how often you rebuild your schemas project, but it may be handy to reference the schemas DLL on disk instead of the schemas project in your solution.

Keep in mind though, that a change in the schemas, will need you to rebuild the schemas project again and afterwards the mappings project to take the new version into account.

zurebe-pieter
  • 3,246
  • 21
  • 38
  • Are there any potential pitfalls with this, specifically in terms of deployment? I wonder what happens since with that method, when deploying the map project it will not deploy the schema project like it normally would... – MarioDS Jul 03 '14 at 09:34
  • In my humble opinion: not that I know of. I do it often and never had any issue, except for the fact that you have to remind yourself to rebuild the schema project after each change. – zurebe-pieter Jul 03 '14 at 13:14
0

This was probably not the best approach in general, but in case it helps someone, I received this error after...

  1. Making a copy of an existing schema file and giving it a temporary file name. I wanted to keep the original around to reference while I completely rewrote this process.
  2. Eventually I deleted the original file and renamed my copy to what the original file was named.
  3. The map could no longer find the schema even though I clearly had a schema file named as such in my schema project. When asked to "pick a new schema," only the temp schema name was in the list.

The fix for me was that I needed to manually update the "Type Name" field in the properties on the schema to match the file name and rebuild. The "Type Name" was still set to the temp file name I had used while rewriting.

bottomsnap
  • 221
  • 2
  • 5