none
entity framework 5 with wcf (connection string) RRS feed

  • Question

  • [please see figures]

    I have two VS2012's solutions using .Net 4.5 as:

    1- (see figure 1) Solution ***with no*** WCF services with modules:

    - generic app named WpfApplication (main window),
    - generic classlib named ServicesModule,
    - generic classlib named EntityMdule using database first.

    HERE everything works fine.

    2- (see figure 2) Solution ***with*** WCF services with modules:

    - generic app named WpfApplication (main window),
    - generic wcfservices named WcfServicesModule,
    - generic classlib named EntityModule using databse first.

    HERE I HAVE ERROR for connectionstring when entity class try to open database.

    Any help?

    Thank you

    Roberto Jucá

    [figure 1]

    [figure 2]


    .NET Developer


    .NET Developer

    Monday, September 3, 2012 9:28 PM

Answers

  • Well I found the solution for this issue. :D

    For WCF services [Solution 2] connection string node generated in app.config file of EntityModule MUST have a copy into app.config file of WcfServicesModule [WCF Services] AND this copy of connection string IS NOT necessary in app.cofig file of WpfApplication.

    That is it, no problem anymore.

    Solution 2 works fine too.

    Done :D

    Roberto Jucá


    .NET Developer

    • Marked as answer by Roberto Jucá Tuesday, September 4, 2012 2:11 PM
    Tuesday, September 4, 2012 2:11 PM

All replies

  • Hi Roberto;

    The most likely cause of the error is that you will need a app.config file in the EntityModule and copy the connection string node from the app.config file in the WpfApplication to the EntityModule.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, September 4, 2012 4:24 AM
  • Hi Fernando,

    Thanks for your reply.

    Figures 1 and 2 shows that connection string node generated in app.config file of EntityModule has a copy into app.config file of WpfApplication.

    Because of this Solution 1 works fine BUT NOT Solution 2 with WCF service.

    Thanks again, :D

    Roberto Jucá


    .NET Developer

    Tuesday, September 4, 2012 1:40 PM
  • Well I found the solution for this issue. :D

    For WCF services [Solution 2] connection string node generated in app.config file of EntityModule MUST have a copy into app.config file of WcfServicesModule [WCF Services] AND this copy of connection string IS NOT necessary in app.cofig file of WpfApplication.

    That is it, no problem anymore.

    Solution 2 works fine too.

    Done :D

    Roberto Jucá


    .NET Developer

    • Marked as answer by Roberto Jucá Tuesday, September 4, 2012 2:11 PM
    Tuesday, September 4, 2012 2:11 PM