Error compiling file in VS 2012 after making changes to model RRS feed

  • Question

  • Hi!

    I'm using Visual Studio Premium 2012 Update 1

    When I update my model in Entity Framework Designer and then try to save changes I got the following errors:

    Error    2    Compiling transformation: "Microsoft.VisualStudio.TextTemplating201201804A0B859ABE469DD8052F80115E5EA89D57CB69DF4E2C99E60253FA4DDBB2594AF138EEFC0D8C376F018BD8B374C8A0EBF54FF4ACBD8D62B08D317992.GeneratedTextTransformation.MetadataConstants" не содержит определение для (doesn't contain definition for) "EDMX_NAMESPACE_V2"    e:\Projects\******\    335    47  

    Error    1    Compiling transformation: "Microsoft.VisualStudio.TextTemplating201201804A0B859ABE469DD8052F80115E5EA89D57CB69DF4E2C99E60253FA4DDBB2594AF138EEFC0D8C376F018BD8B374C8A0EBF54FF4ACBD8D62B08D317992.GeneratedTextTransformation.MetadataConstants" не содержит определение для (doesn't contain definition for) "MSL_NAMESPACE_V2"    e:\Projects\******\    334    45

    The lines of code that generate errors are:

        nsmgr.AddNamespace("ef", MetadataConstants.MSL_NAMESPACE_V2);
        nsmgr.AddNamespace("edmx", MetadataConstants.EDMX_NAMESPACE_V2);

    The model was created in VS 2010 and in 2010 Entity framework designer it still works correctly.

    Wednesday, January 30, 2013 9:56 AM

All replies

  • Hi,

    How did you modify the model? In design? Which approach do you use? Database First? Model First?

    Thursday, January 31, 2013 5:53 AM
  • Hi,

    I use Database first.

    In fact any change in the Designer (adding some new entity, association, etc. or just moving entity on diagram) and saving that change causes this error.
    Thursday, January 31, 2013 7:05 AM
  • Hi,

    I think it is not a good choice to modify database in Database First approach. If you update database from current model, the database will be dropped and created and the data will lose. The modification features I think is design for Model First.

    Thursday, January 31, 2013 9:34 AM
  • Hi,

    I had a quick go at reproducing this and wasn't able to. Are you able to provide something that reproduces the problem?

    I tried to:

    1. Create a project in VS2010 and reverse engineer from database

    2. Open project in VS 2012 Update 1

    3. Update model from database

    I didn't get any errors in doing the above steps, I also run the app and inserted some data and everything looks good. Is there something that I'm missing?

    We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.

    Tuesday, February 5, 2013 9:16 PM
  • Hi Menshikn

    I'm having the same problem.
    How did u solve it?


    Wednesday, May 15, 2013 6:16 PM