一个项目引用另一个项目中的方法时,出现 在应用程序配置文件中找不到名为“SSREntities”的连接字符串。

出现原因:至今不清楚,希望有大佬能够补充
解决方法:在被引用项目的配置文件中复制这个配置字节到引用项目的配置文件中,完美解决

出现错误。 在应用程序配置文件中找不到名为“SSREntities”的连接字符串。 System.InvalidOperationException 在 System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel() 在 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() 在 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) 在 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() 在 System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() 在 System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator() 在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) 在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 在 SSR.SSRDataSel.SSRInfoToListJson() 位置 D:\urabby\netback\SSR\SSRDataSel.cs:行号 27 在 netback.API.SSR.SSRSelController.Get() 位置 D:\urabby\netback\netback\API\SSR\SSRSelController.cs:行号 17 在 lambda_method(Closure , Object , Object[] ) 在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters) 在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) 在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()

你可能感兴趣的:(C#,EF建模)