.NET 4: How to configure EDMX file in other assembly in Web.Config

后端 未结 3 1317
心在旅途
心在旅途 2020-12-17 23:41

I have a problem with configuring an EDMX file that lives in an other assembly than by web project. My project looks somewhat like this:

Project 1
--> Dat         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 00:23

    Easier way is to take connection string from Web.Config and copy them into App.Config and point EDMX's connectionstring to same DB information. e.g

      
        
        
      
    

    Also you need to check if the namespaces are correct if you have moved Database.edmx from Project 2 to Project 1, which you can check by opening Database.edmx and goto code behind.

提交回复
热议问题