Possible Bug: Error Compiling BizTalk Project with multiple X12 Schemas RRS feed

  • Question

  • Greetings,

    I have been putting together BizTalk project containing the X12 schemas I am planning on using.

    However, when I compile the project, I get the following:

    Updating references...
    Performing main compilation...
    c:\@Work\PDE DotNet 2.0\source code\BizTalk\Retail.Schemas\Retail.Schemas.X12\AssemblyInfo.cs(21,12): warning CS1699: Use command line option '/keyfile' or appropriate project settings instead of 'System.Reflection.AssemblyKeyFile'

    error CS0013: Unexpected error writing metadata to file 'c:\@Work\PDE DotNet 2.0\source code\BizTalk\Retail.Schemas\Retail.Schemas.X12\obj\Debug\~Retail.Schemas.X12.dll' -- ''

    Build complete -- 1 errors, 1 warnings

    Now, if I exclude some schemas, the project will then compile.

    I was able to re-create this be creating a schemas project and including the following X12 schemas:


    When I included all of those, I got the error above,

    when I excluded all the 5010 schemas except for 810 and 827, it compiled fine. 
    If I exclude the 5010-827 schema and included the 5010-850 and it failed
    If I exclude the 5010-810 schema (leaving the 5010-850 in) it compiled fine.

    I am suspecting it is related to the sizes of the schemas, as it is being built.

    I was able to re-create this without any issue just using 4010s as well (using the schemas above as well as 4010-100 -> 4010->129)

    As a work around, I will just split the 5010 and 4010s into separate projects.

    Is anyone else encountering this problem?

    Friday, April 13, 2007 7:59 PM


All replies

  • There's a limitation on the size of generated assembly in Visual Studio. Please see "BTS06 developers troubleshooting guide" at


    "Minimize the size of your BizTalk project. The Visual Studio compiler will not successfully compile a project if it would result in an assembly larger than 75 megabytes. When the compiler reaches a size constraint it will emit fatal error CS0013 "Unexpected error writing metadata to file <filename>" and halt. "

    Saturday, April 14, 2007 7:51 PM
  • Thanks, That would be the issue.


    Just looking at the my assembly with the 4010 version of 810, 824, 850, 855, 857 and 997, the dll is 30 megs in size..  Wow. 


    Is there going to be any sort of impacts on BizTalk while it loads an assembly of this size or is it just going to affect the footprint of the biztalk process that loads it?

    Monday, April 16, 2007 5:30 PM
  • Hi:    I am using BizTalk 2004(w/o any service pack) on win2k server with sql    server 2002/service pack 3a.    When I compile my schema project. I receive this error:    820Schema.xsd: error BEC2004: XSD2EDI failed to convert XSD: Segment: SLN    All services are running as current user log in, who is having admin rights    to the box.    Any ideas??                      
    Saturday, July 5, 2008 10:31 PM
  • Hey Craig,


    I have got a similar issue , as we have a schemas project loaded with EDI schemas and I am getting the 'Unexpected error writing metadata info...'.

    Is there some work around for this size factor  other than creating a new biztalk project and including the schemas in that??




    Thursday, July 24, 2008 12:45 PM
  • I am also hitting this error with a large schema library, I want them in a .dll so I can easily add multiple schemas to further development projects. After assuming my initial error was because of the 75 MB limit, I broke the library into fourths and attempted to rebuild. The first fourth built fine but the remainder also threw the "metadata" error. 

    I started removing files one by one and eventually got each assembly to build, but the resulting assemblies are nowhere near the 75 MB limit and the addition of any additional schema causes the error to return even though none of the additional files should boost the assembly by enough to put it over the edge, does anyone have additional insight?


    Thursday, October 23, 2008 11:29 AM
  • Additionally, I seem to have run up against a hard limit of seven (7) BizTalk X12 Schemas in one project, I built a project with 7 4010 schemas, the 8th broke it. I then tried 7 different 4010 schemas which again built, and an 8th again broke the build.

    The builds with 7 schemas were 31 MB and 30 MB respectively. As you can see neither is near the supposed 75 MB limit and even combined they should build.

    Does anyone have further information about this 7 schema limit?


    P.S. - The 7 schema limit seems limited to the X12 schemas at this point, I was able to put at least 9 dummy schemas in a project and built just fine.
    Thursday, October 23, 2008 12:13 PM
  • I have seen this issue before, and is there any reason why you want to add difficulty to the process?
    It is not a schema number limiitation, it is a size limitation, and that limitation is based on the available memory on your system. I would recommend compiling those into indivual projects/dlls and then referencing them thru your project correctly.


    Tuesday, November 25, 2008 9:20 PM
  • The goal was to minimize the number of DLLs to be deployed to alleviate some management concerns as well as to ease some programatic build and deployment processes, we've worked around the issue at this point, but I still don't understand why I'm hitting what would appear to be a size limit error when my file size is ~40MB below the Microsoft published 75MB limit.

    Unfortunately I don't have the time to dig further into the issue right now, but if anyone knows definitively why this happens, it would be nice to have the info to file away in the old noggin' 


    Monday, December 1, 2008 4:45 AM
  • I also get this error.

    fatal error CS0013: Unexpected error writing metadata to file 'c:\myassembly.dll' -- 'No logical space left to create more user strings.'

    It seems to be an issue in the way Visual Studio is building the object code for the XSD files.  If you use reflector to look inside the assembly, you'll see huge string constants, two copies per object. Hence filling up the user string space.

    once in private const string _strSchema = "<?xml vers...


    once in
    public override string XmlContent
    return "<?xml version...

    My question would be is there some other way to reference the XSD's in the Biztalk Project?  I can't imagine that Microsoft would effectively limit to seven X12 schema's in a prjoect.

    Is the "established" method to just build separate assemblies?  Acme.EDI.Schema.X12a, Acme.EDI.Schema.X12b, Acme.EDI.Schema.X12c, Acme.EDI.Schema.X12d until you've managed to cover all your required Schemas?



    James Curry - EDI Admin - Samtec Inc
    Monday, June 22, 2009 3:58 PM
  • Is it possible this limit is only half the size (37.5 MB) on a 64 bit build machine??  Through careful inclusion and exclusion of a few files in my project, I have gotten the file size to b just shy or 34 MB but when I add any other thing, Schema, Map, that I guess would push it over the 1/2 way point it fails with this exception. 

    The files I've excluded were built in a previous version of this application without issue.  What started it is adding a series of maps which  will compile themselves if I include only the things that are needed for them.  I will likely move the maps this weekend and see if that solves the issue, but wanted to see if anyone else has had a similar experience.

    Saturday, March 27, 2010 7:48 PM
  • Just as an FYI, this issue is the result of the way Visual Studio loaded references to schemas.  There was another issue which was even more pressing which was that the IDE would take an hour or more to load if given enough schemas in a solution and an open map.  Even worse was that it would take a considerable amount of time to open any additional maps at that point. 

    MS has fixed the delayed issue in the last pack for BizTalk 2006 R2 and it has since taken at most 1 minute to load complex maps with detailed schemas (thus far).



    Monday, September 27, 2010 10:37 PM