내 프로젝트에서 VS 2012를 사용하고 있으며 이러한 XAML 디자이너가 압도적 인 상태입니다. 여기 Xaml 디자이너가 충돌 함
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
No connection string named '************' could be found in the application config file.
at System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
at *************.ViewModel.**********.<GetReferralList>b__1d() in d:\******.cs:line 422
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at ***************.<GetReferralList>d__29.MoveNext() in *******************\MainTabViewModel.cs:line 391
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__1(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
그리고
당신은 디자이너에서 작동하지 않는 데이터베이스에 액세스하려고await Task.Run(() =>
{
using (var context = new SCMEntities())
{
var listOfGenRefReg = context.GenericReferralRegistrationIs;
foreach (var item in listOfGenRefReg)
{
Application.Current.Dispatcher.Invoke(() =>
LastReferrals.Add(item));
}
}