生成错误 - 异常SqlCeManager无法初始化 [英] Build Error - Exception SqlCeManager Could Not Be Initialized

查看:85
本文介绍了生成错误 - 异常SqlCeManager无法初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此构建错误


 


InternalError:无法初始化SqlCeManager


 


就像这里描述的那样


http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/33adca12-9918-4c83-ba82-1ed0a2f96b32


我只是想做非常基本的(Hello World风格)应用程序。  我在Windows 7上安装了VS2010 SP1和LightSwitch Beta 2,带有SQLExpress和Northwind数据库。


我第一次执行这些步骤时工作正常,该项目仍然有效


1。制作一个新的C#LS项目


2。将数据源添加到本地SQLEXPRESS,从下拉列表中选择Northwind,测试连接:确定


3。选择员工表,设计师显示它


4。选择一个屏幕,连接到员工(任何屏幕都有问题)


5。 Build,get:  异常SqlCeManager无法初始化


如果我再次执行这些确切步骤,则会出现构建错误。


如果我接受工作项目并添加本地数据源,我将开始收到相同的错误


它实际意味着什么 - 我该如何解决?


我肯定在表中有主键,而且第一次使用它时,它运行正常。  如果我制作该项目的副本,它可以正常工作,但如果我尝试制作一个新项目,我会收到此构建错误。


我在工作中做了一个完整的差异和非工作的项目文件夹,并且数据目录中的mdf / ldf文件有所不同,所以我真的不知道区别是什么。


试过,干净的构建,重启VS,停止/启动sqlexpress,重新启动等等。

解决方案


LightSwitch使用Visual Studio数据库开发工具(又名TS数据)来构建应用程序的内部数据库。 TS Data 反过来使用SQL Express Compact Edition来管理架构模型。您收到的错误表明问题
使用 SQL Express Compact Edition ,而不是SQL Express实例。


我在TS Data论坛中发现了这篇文章解决同样的错误:
http: //social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/d840ad7c-fa69-45c3-8783-9a978e9ffe29/


在该帖子中,问题发生的原因是%TEMP%目录已映射到远程存储。您的机器是这种情况吗?


否则,您可以尝试启用TS数据跟踪并查看是否有更多信息。以下是如何启用TS数据的跟踪,从上面的帖子中获取:


"通过在产品目录中运行reg文件,可以启用数据库项目的跟踪。要启用跟踪:


1.打开位于产品目录中的注册表文件。 %Program Files%\ Microsoft Visual Studio 10.0 \ VSTSDB \Tracing.reg


2.编辑文件并将其副本保存到临时目录。设置TraceSwitch = 00000001,TraceToLogFile = 00000001,DisplayCallStack = 00000001,LogDir =“ c:\\Temp \\ VSTSDB”


3.双击临时目录中的新文件,将条目添加到注册表


4.如果打开则重新启动Visual Studio。对于下一个Visual Studio实例,日志记录集将变为活动状态之前,需要关闭所有Visual Studio实例。

 

您应该找到日志目录并添加日志对于每个数据库项目使用会话。发生错误时,您应该有一个错误的完整日志条目,包括堆栈。

 

Tracing.reg文件在添加之前应如下所示注册表。

 

Windows注册表编辑器版本5.00

[HKEY_CURRENT_USER \Software\Microsoft\VisualStudio \10.0 \ VSTSDB \ Tracing]

" LogDir" =“ c:\\Temp \\VSTSDBTRACE&rd ;;
" PrefixTime" = dword:00000001

" PrefixPid" = dword:00000001

" PrefixThreadId" = dword:00000001

" TraceSwitch" = dword:00000001

" TraceToLogFile" = dword:00000001

" TraceToDebugOutput" = dword:00000000

" DisplayCallStack" = dword:00000001

" UniqueLogFile" = dword:00000001

" EventIdsToTrace" = dword:0001ffff"


祝你好运,

Huy


I am getting this build error

 

InternalError: SqlCeManager could not be initialized

 

like the one described here

http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/33adca12-9918-4c83-ba82-1ed0a2f96b32

I am just trying to do very basic (Hello World style) applications.  I have VS2010 SP1 and LightSwitch Beta 2 on Windows 7 with SQLExpress and the Northwind database.

The first time I did these steps it worked fine, and that project still works

1. Make a new C# LS project

2. Add a datasource to the local SQLEXPRESS, choose Northwind from the dropdown, test connection: OK

3. Pick Employees table, designer shows it

4. Pick a screen, connect to Employees (any screen has a problem)

5. Build, get:  Exception SqlCeManager Could Not Be Initialized

If I do these exact steps again, I get the build error.

If I take the working project and add a local datasource, I will start getting the same error

What does it actually mean -- how can I troubleshoot it?

I definitely have primary keys in the table, and the first time I did it, it works fine.  If I make a copy of that project, it works fine, but if I try to make a new one, I get this build error.

I did a full diff on a working and non-working project folder, and there are differences in the mdf/ldf files in the data directory, so I don't really know what the difference is.

Tried, clean builds, restarting VS, stop/start sqlexpress, reboots, etc. 

解决方案

Hi,

LightSwitch uses Visual Studio Database Development Tools (aka TS Data) to build the application's intrinsic database. TS Data in turn uses SQL Express Compact Edition to manage the schema model. The error you are getting indicates an issue with SQL Express Compact Edition, not the SQL Express instance.

I found this post in TS Data forum addressing the same error: http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/d840ad7c-fa69-45c3-8783-9a978e9ffe29/.

In that post, the issue happened because the %TEMP% directory was mapped to a remote storage. Is that the case with your machine?

Otherwise, you can try enable tracing for TS Data and see if there is more information. Here's how to enable tracing for TS Data, taking from the post above:

"You enable tracing for database projects by running the reg file in the product directory. To enable tracing:
1.Open registry file located in the product directory. %Program Files%\Microsoft Visual Studio 10.0\VSTSDB\Tracing.reg
2.Edit the file and save a copy of it to your temp directory. Set TraceSwitch = 00000001, TraceToLogFile= 00000001, DisplayCallStack= 00000001, LogDir = “c:\\Temp\\VSTSDB”
3.Add the entry to the registry by double clicking the new file from your temp directory
4.Restart Visual Studio if open. All instances of Visual Studio need to be closed before logging set will become active for the next instance of Visual Studio.
 
You should find the log directory and log added for each session of database project usage. When an error occurs, you should have a complete log entry for the error including the stack.
 
The Tracing.reg file should look like the following before adding to registry.
 
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\VSTSDB\Tracing]
"LogDir"=“c:\\Temp\\VSTSDBTRACE”
"PrefixTime"=dword:00000001
"PrefixPid"=dword:00000001
"PrefixThreadId"=dword:00000001
"TraceSwitch"=dword:00000001
"TraceToLogFile"=dword:00000001
"TraceToDebugOutput"=dword:00000000
"DisplayCallStack"=dword:00000001
"UniqueLogFile"=dword:00000001
"EventIdsToTrace"=dword:0001ffff"

Best regards,
Huy


这篇关于生成错误 - 异常SqlCeManager无法初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆