【发布时间】:2014-07-07 07:11:40
【问题描述】:
我已经使用实体框架和 WPF 启动了一个 MVVM 应用程序。在 MainWindow.xaml 我写了这个:
<Window x:Class="MVVMAttempt.App.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="400" Width="525"
DataContext="{StaticResource StudentVM}">
我在 App.xaml 中写了这个:
<Application.Resources>
<vms:StudentVM x:Key="StudentVM" xmlns:vms="clr-namespace:MVVMAttempt.App.ViewModels"/>
</Application.Resources>
项目运行正常。但是有一个问题。在 Visual Studio 上打开 MainWindow.xaml 时,程序开始运行非常缓慢。我也收到以下错误:
错误 1 发生网络相关或特定于实例的错误,同时 建立与 SQL Server 的连接。找不到服务器或 无法访问。验证实例名称是否正确,并且 SQL Server 配置为允许远程连接。 (提供者:SQL 网络接口,错误:26 - 定位服务器/实例时出错 指定)C:..MVVMAttempt\MVVMAttempt.App\App.xaml 3 9 MVVMAttempt.App
我该如何解决这个问题?谢谢。
【问题讨论】: