locked
WCF Oct 11 CTP: DataSvcUtil Error 7001 RRS feed

  • Question

  • Hi,

    after getting the Oct 11 CTP of ADO.NET dataservices to wrap my linq2sql in an odata service, I am trying to use DataSvcUtil to generate a proxy, but am getting the following error.

    Writing object layer file...
    error 7001: Schema specified is not valid. Errors:
    (0,0) : error 0161: The namespace 'System' is a system namespace and is implicit
    ly referred by every schema. You cannot specify an explicit reference to this na
    mespace.

    using fiddler, I see this in the edmx (i **think** the last line is the issue...

    <?xml version="1.0" encoding="utf-8"?>
    <edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
    <edmx:DataServices m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <Schema Namespace="CC.Linq.App" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
    <Using Namespace="CC.Linq.Club" Alias="CC_Linq_Club_Alias" />
    <Using Namespace="CC.Linq.Member" Alias="CC_Linq_Member_Alias" />
    <Using Namespace="System" Alias="System_Alias" />

    What could be causing this?

    Thanks,

    Oli

    Monday, February 20, 2012 10:57 PM

Answers

  • OK. I've sorted it. One of my SQL views references the system view sys.extended_properties and returned the value column. This was translated into a sql_variant type, which my linq generator decided was of object type. This caused the  <Using Namespace="System" Alias="System_Alias" /> to be added to the generated edmx, hence the failure. I hope this helps someone in the future....

    FYI, I had to cast it to varchar(max) in the view definition in SQL..

    • Marked as answer by dogzb0110x Tuesday, February 21, 2012 11:36 AM
    • Edited by dogzb0110x Tuesday, February 21, 2012 11:37 AM
    Tuesday, February 21, 2012 11:36 AM

All replies

  • OK. I've sorted it. One of my SQL views references the system view sys.extended_properties and returned the value column. This was translated into a sql_variant type, which my linq generator decided was of object type. This caused the  <Using Namespace="System" Alias="System_Alias" /> to be added to the generated edmx, hence the failure. I hope this helps someone in the future....

    FYI, I had to cast it to varchar(max) in the view definition in SQL..

    • Marked as answer by dogzb0110x Tuesday, February 21, 2012 11:36 AM
    • Edited by dogzb0110x Tuesday, February 21, 2012 11:37 AM
    Tuesday, February 21, 2012 11:36 AM
  • Hi dogzb0110x,

    Thanks for sharing your experience here.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 23, 2012 6:48 AM
    Moderator