Le réseau pour les développeurs > Forums - Accueil > LINQ to SQL (Pre-Release) > Linq-to-SQL associations being silently ignored under VS2010
Poser une questionPoser une question
 

TraitéeLinq-to-SQL associations being silently ignored under VS2010

  • vendredi 26 juin 2009 06:43EvilPenguin Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Hi,

    I have a Linq-to-SQL DBML set referencing the SQL Server system views (sys.tables, sys.columns, etc) which was created in fully patched Visual Studio 2008 SP1.  I'm pretty sure it worked in 2008, but I can no longer confirm.
    I reformatted and installed Windows RC and VS2010.  The Associations still exist in the DBML and I can see them on the designer surface, but the generated code does not contain the expected children collection/parent references.

    I have other similar DBML sets that work perfectly fine (although they are to tables, not views).  If I recreate a sample using just the tables and columns views, I get the same result.
    I get no errors or warnings either from 'Run Custom Tool' or building.

    Has anyone else had any similar problems or have any suggestions?

Réponses

  • lundi 29 juin 2009 02:43EvilPenguin Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    I found the problem - VS2010 beta 1 doesn't seem to report warnings from the custom tool.
    I found a source backup from before I switched, and recompiled it in VS2008.  I got compiler warnings that I had forgotten to specify Primary Keys on all of the tables, so no associations would be generated.

    Strangely, it at some point had actually generated the correct code without the PKs set.
    • Marqué comme réponseEvilPenguin lundi 29 juin 2009 02:43
    •  

Toutes les réponses

  • lundi 29 juin 2009 02:43EvilPenguin Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    I found the problem - VS2010 beta 1 doesn't seem to report warnings from the custom tool.
    I found a source backup from before I switched, and recompiled it in VS2008.  I got compiler warnings that I had forgotten to specify Primary Keys on all of the tables, so no associations would be generated.

    Strangely, it at some point had actually generated the correct code without the PKs set.
    • Marqué comme réponseEvilPenguin lundi 29 juin 2009 02:43
    •