Entity Framework - Unable to load the specified metadata resource

前端 未结 17 1263
一生所求
一生所求 2020-12-14 15:21

I realise that this has been asked a number of times but I just can\'t seem to get the bottom of my issue. I\'m getting the following error stack:

17条回答
  •  借酒劲吻你
    2020-12-14 15:40

    I want to share my experience on this and how I solved it. In my case it happens because I copy and pasted my connection string on production server. My application was using Entity framework.

    Problem was on metadata

    I named my entity model as 'BetModel' but on my connection string I was using 'Entity' - 'res:///Entity.csdl|res:///Entity.ssdl|res://*/Entity.msl' on 'metadata' (reason was because i copy pasted it).

    So my wrong ConnectionString was:

    connectionString="metadata=res://*/Entity.csdl|res://*/Entity.ssdl|res://*/Entity.msl;provider=System.Data.SqlClient;provider connection string="data source=;initial catalog=;persist security info=True;user id=;password=;MultipleActiveResultSets=True;App=EntityFramework""
    

    and the corrected ConnectionString was:

    
    

提交回复
热议问题