Namespace in version Q1 2011 is repeated in VB.NET

24 posts, 0 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 16 Mar 2011 Link to this post

    Hello,

    Just trying the new version Q1 2011 in VB.NET (VS2010)

    problem with namespace... 

    In the Wizard new model, on the first page, the Model Namespace is asked. When using the default setting (project namespace) it places a namespace from the project obove everything with the project root namespace, resulting in:

    Imports Xxx.Data.EntitiesOpenAccessORM.v1.Xxx.Data.EntitiesOpenAccessORM.v1
     
    Namespace Xxx.Data.EntitiesOpenAccessORM.v1
     
        Public Partial Class EntitiesModel
             Inherits OpenAccessContext
    ....

    Oops...


  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 16 Mar 2011 Link to this post

    Hi Proovit,

     Actually this behavior is by design and it does not create compilation errors with the generated code. With previous versions of the product we had problems that in some situations the context did not have all of the necessary Import statements depending on whether the project has Root Namespace or not. We have made the ultimate solution for the problem by adding an Import statement inside the context class for each endpoint it has. The Import statement includes the Full Namespace of the referenced class which has the format of 'RootNamespace.ActualNamespace'. I am aware that it can sometimes give you warning for the generated context class, but in the long run it is a solution to many of our problems from previous versions.

    Do you, for any reason have problems working with this code, or is it non-compilable on your side? I really hope that this is just a point you are making and not an actual problem that stops your work with the product. Looking forward to read back from you.

    All the best,
    Zoran
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Russell
    Russell avatar
    10 posts
    Member since:
    Jan 2007

    Posted 16 Mar 2011 Link to this post

    I am getting build errors from the namespace change.  Everything is fine after upgrading to the Q1 2011 release until I modify a diagram.  Any change to the diagram will result in build errors in my partial classes. 

    The new release is adding 3 lines to the .generated.vb and diagram.vb files.

    Imports ProjectNamespace.ProjectNamespace

    Namespace ProjectNameSpace
    End Namespace

    If I remove those 3 lines from all the files it will build, but it will still give 1 error: "Unable to find the runtime mapping information".

    I see a new .rlinq.diagram file is created and is not included in the project. If I manually include in the project it still gives the error.
  5. richard
    richard avatar
    9 posts
    Member since:
    Jul 2012

    Posted 16 Mar 2011 Link to this post

    FYI - After upgrading to 2011 Q1, changing the namespace everywhere, I am also getting the same error - "Unable to find the runtime mapping information" The project still compiles and works, so this is not a complaint. 
  6. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 17 Mar 2011 Link to this post

    Yeah,

    Same error here, namespaces are implemented differently in VB to C#, not sure if this has been taken into account.

    Worse still, when I import a single table into the model and go to the CUD mappings the VS IDE crashes (see attached pic).

    I was having issues with CUD mappings in Q3 2010 release but at least it didn't crash Visual Studio.

  7. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 17 Mar 2011 Link to this post

    Forgot the version info:

    Attached another screenshot.

    Microsoft Visual Studio 2010
    Version 10.0.30319.1 RTMRel
    Microsoft .NET Framework
    Version 4.0.30319 RTMRel

    Installed Version: Professional

    Microsoft Office Developer Tools   01018-532-2002181-70216
    Microsoft Office Developer Tools

    Microsoft Visual Basic 2010   01018-532-2002181-70216
    Microsoft Visual Basic 2010

    Microsoft Visual C# 2010   01018-532-2002181-70216
    Microsoft Visual C# 2010

    Microsoft Visual C++ 2010   01018-532-2002181-70216
    Microsoft Visual C++ 2010

    Microsoft Visual F# 2010   01018-532-2002181-70216
    Microsoft Visual F# 2010

    Microsoft Visual Studio 2010 Team Explorer   01018-532-2002181-70216
    Microsoft Visual Studio 2010 Team Explorer

    Microsoft Visual Web Developer 2010   01018-532-2002181-70216
    Microsoft Visual Web Developer 2010

    .NET Memory Profiler   3.5
    .NET Memory Profiler Visual Studio.NET Integration Package

    Crystal Reports Templates for Microsoft Visual Studio 2010  
    Crystal Reports Templates for Microsoft Visual Studio 2010

    Microsoft Visual Studio 2010 SharePoint Developer Tools   10.0.30319
    Microsoft Visual Studio 2010 SharePoint Developer Tools

    tangible T4 Editor   1.0
    tangible T4 Text Template Editor - T4 Editor

    Telerik OpenAccess ORM   2011.1.316.3
    Telerik OpenAccess ORM Copyright (C) 1996-2011 Telerik; OpenAccess is the Object-Relational Mapping Tool for the Microsoft .NET Platform. www.telerik.com

    Telerik WinForms VSExtensions   2010.03.1214.0
    Telerik RadControls for WinForms VSExtensions Package

    Telerik WPF VSExtensions   2010.03.1214.0
    Telerik RadControls for WPF VSExtensions Package

    VisualStudioIntegration2010   1.0
    Information about my package

    .NET Reflector

  8. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 17 Mar 2011 Link to this post

    Hi Zoran,

    Yes, wrote a post on that last week, also namespace issues, in the previous version, but that was only if you set a namespace.

    I just created a sample console application, and kept everything standard, but then my context model is only accessible via 

    ConsoleApplication2.ConsoleApplication2.EntitiesModel

    That seems strange to me, especially because the first page of the wizard says: "Use project namespace"... The project namespace is 
    ConsoleApplication2, and not ConsoleApplication2.ConsoleApplication2...

    The model looks like this:
    Imports ConsoleApplication2.ConsoleApplication2 ' << ?
     
    Namespace ConsoleApplication2  ' << ?
         
        Public Partial Class EntitiesModel
             Inherits OpenAccessContext
    ...

    Using the model looks like this:
    Using DC As New Global.ConsoleApplication2.ConsoleApplication2.EntitiesModel
        Dim Usrs As List(Of Global.ConsoleApplication2.ConsoleApplication2.UserEntity) = DC.UserEntities.ToList
    End Using

    Choosing the second option, "Use custom defined" is working fine, but now we MUST put our model in a namespace. This can be a design chooise of course and is not a problem for me, but is is not possible now to add a model to a project root namespace.

    Also:
    1) Sometimes I get "Operation could not be completed" messagebox when i try to run.
    2) When i delete the model and add a new model, I can't run the application anymore (exe and console). I have to close VS and reopen it, and than everything runs fine... ;-|

  9. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 17 Mar 2011 Link to this post

    btw,

    Removing the project namespace when you create a new project sorts out the Visual Studio IDE crash when using VB and ORM.

    Hopefully will be sorted in the Q1 2011 service pack release.
  10. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 17 Mar 2011 Link to this post

    Hello Norman,

    Thanks for the report. The issue you are seeing is already fixed. Until then you can go with a simple workaround and that is having your projects that contain entity diagrams without a root namespace. This is also a solution for all guys that do not want a prefix prepended to their classes namespaces. That is after all by design with Visual Basic projects as Type discovery during runtime is not possible without prepending the root namespace as part of the full name of the types defined in that project. If for example you load a persistent Type that is defined in Namespace1 using reflection, and then ask for the Namespace of that type - you will get RootNamespace.Namespace1.

    All the best,
    Zoran
    the Telerik team
  11. Russell
    Russell avatar
    10 posts
    Member since:
    Jan 2007

    Posted 17 Mar 2011 Link to this post

    Removing the root Namespaces will break all kinds of things.  Especially other projects that reference the one with the entity diagrams.

    Any idea when the update will be available?
  12. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 18 Mar 2011 Link to this post

    Hi Russell,

     We will probably replace the build on our web page next week with few bug-fixes of this kind,  but we have not yet made the final decision on this one. The official Service Pack should be available in about three weeks. I will give you an update in this forum as soon as we have a new build online.

    Greetings,
    Zoran
    the Telerik team
  13. David Gerding
    David Gerding avatar
    44 posts
    Member since:
    Sep 2005

    Posted 18 Mar 2011 Link to this post

    Hi,
    I'm getting the same "mapping not found" behavior.  I deleted my old OpenAccess rlinq node in a the project, added a new one, the entities I want etc... but I when I try to build the project I get:

    Error 4 Unable to find the runtime mapping information. Construct.Sources.Model

    Will post as ticket, too, but this is urgent.  Was counting on the new release :)

    Thanks,
    Dave Gerding
  14. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 18 Mar 2011 Link to this post

    @David

    I found that deleting and re-add a model had a lot of problems. For one, the test project (an exe and later a console app) didn't run. I had to close VS2010 in order to get it to run. bit curious..

    Also the "re-adding" gave me some problems in the model, pretty much as you describe right now. Starting a new project did do the trick always.

    Hope it helps you...
  15. David Gerding
    David Gerding avatar
    44 posts
    Member since:
    Sep 2005

    Posted 19 Mar 2011 Link to this post

    Proovit,
    Thanks, I'm going to go try that now.

    Dave G
  16. David Gerding
    David Gerding avatar
    44 posts
    Member since:
    Sep 2005

    Posted 19 Mar 2011 Link to this post

    Hi,
    I forgot to mention that I tried a clean, new Telerik WPF project, added an OpenAccess project, mapped Northwind and get the same "no mapping" result.

    I'm now going to try with a new solution... since that's the only thing in common.

    Anyone from Telerik following this thread?
    Dave
  17. David Gerding
    David Gerding avatar
    44 posts
    Member since:
    Sep 2005

    Posted 19 Mar 2011 Link to this post

    Hi Zoran,
    I know it's soon - but please post any internal builds that you have.  I can reproduce the "no mapping error" using a new, clean solution.  I've posted that solution (7mb - too big for here) as a trouble ticket under my account.  I can't use the q1 release at all - which means I now have to regress back to q3.

    Help :)

    Thanks,
    Dave Gerding
  18. David Gerding
    David Gerding avatar
    44 posts
    Member since:
    Sep 2005

    Posted 20 Mar 2011 Link to this post

    Hi All,
    Here's the text of what I sent in my related trouble ticket - hope it helps others and would love to know what the point of this error message is.  Is it real?  I haven't yet bound to successfully to any 2011Q1 OpenAccess entities collection.  

    It took me a long time to realize that the "mapping not found" compile time error wasn't really a compile time error .... in that the runtime does run in debug mode.  But, sadly, that doesn't mean that I've gotten the thing to work  :)

    Okay,
    I am able to RUN the application even though all 5 projects produce the complie time error. If it turns out that this "error" is "really" a warning please mark it as such. I'm used to compile time errors indicating the code will not run. I spent a lot of time trying to solve the compiler error before running the executable.
    ....
    If this error behavior is expected appropriate, please clarify with the community and, perhaps, a more explanatory error message.

    Thanks,
    Dave G

    Thanks to all,
    Dave G



  19. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 20 Mar 2011 Link to this post

    Please post as soon as possible.  I also want to voice that this has caused a huge issue across all my dependent projects.

    Brent
  20. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 22 Mar 2011 Link to this post

    Hello All,

     The new build should be available by the end of today, I will update you as soon as it is online. However, regarding the enhancer error regarding the runtime mapping - we really apologize for the confuse this has created. It is indeed a warning and the product works as expected even with this error popping out in the ErrorList of Visual Studio. Some additional minor fixes have been done as well.

     Regarding the namespaces in VB .NET projects, this can provide to be a breaking change for some existing projects, but this is ultimately fixing all of the issues we had with VB in previous versions. There we had issues with the RootNamespace not being accounted in our designer. When a user tried to set Namespace explicitly for a class, Import to the RootNamespace was missing as the FullName of the class in that case is RootNamespace.Namespace.ClassName. In order to have consistent behavior, we are always having account for the RootNamespace, no mater if it is the same as the class namespace. That is why we sometimes generate imports like RootNamespace.RootNamespace.

    Best wishes,
    Zoran
    the Telerik team
  21. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 23 Mar 2011 Link to this post

    No new build yet?  Don't see it out there.

    What exactly is changed/fixed in the new build with regard to the namespace issue?  I played with the new release and it really wreaked havoc on existing projects (from a lot of perspectives).  I have a 50 table model and after upgrading/opening it really messed up the designer surface (stacking all the objects/tables on top of each other)...it's really a mess.

    It of course changed the namespace/imports stuff like what has been said in this thread.
    Now I have 60+ warnings that "The persistent type 'xxx' has an incorrect full name ('rootnamespace.rootnamespace.class')."

    What is going on?

    Can't we get an OPTION to make these changes instead of it just completely taking over our projects?  These issues also don't take into account the 100s of errors that will now reside in the consumer projects using this model (now with the screwed up namespace thing).  I really can't spend hours going through all my projects getting this stuff back inline...which is why something like this change needs to be an OPTION.
  22. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 23 Mar 2011 Link to this post

    Zoran,

    Removing the root namespace from VB isn't an option unfortunately in our case.

    I did it in our test ORM harness app (to stop the Visual Studio crash) as that was a small test app but in our main WPF framework application I can't remove the root namespace as it'll cause all sorts of issues with usercontrols etc.

    I reported the namespace bug last week and was assured it would be resolved as it crashed the VS IDE.

    I think Shawn's question is important, we need to know what this release will resolve.

    I'm supposed to start a new product using WPF, WCF &  ORM, we're just seing how it performs at the moment, the namespace thing in VB is a big question mark.

    Regards,
    Norman.



  23. Jeff
    Jeff avatar
    6 posts
    Member since:
    Jul 2010

    Posted 24 Mar 2011 Link to this post

    I have a C# project that I have tried upgrading and I am still getting the error Unable to find the runtime mapping information.  Will the C# changes be fixed with the new build also?  Thanks

    Jeff
  24. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 25 Mar 2011 Link to this post

    Hello All,

     The internal build is available on our web site and I suggest that all of the participants in this thread to download it and install it. The reason is that we have fixed all of the issues that you reported here, including the change of behavior in the Namespace generation in Visual Basic. All issues that were reported here as well as in other support threads from the Q1 official release, have been fixed for this internal build.
    I hope all of you can continue their work with OpenAccess in a more smoother manner without having all the small glitches that have been mentioned.

    Regards,
    Zoran
    the Telerik team
  25. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 29 Mar 2011 Link to this post

    Hi Zoran and the rest,

    Just want to update this tread for now:

    I did a simple test and both "project namespace" and your own namespace is working well. Got the thing to work!

    Grz

    Erik
Back to Top
DevCraft banner