VS2010 Silverlight 模板未编译:“WebContextBase 未定义”。发生了什么事?我怎样才能让它发挥作用?

发布于 2024-10-22 13:31:05 字数 1528 浏览 2 评论 0原文

我正开始首次探索 Silverlight RIA 和 EF4,但我无法让项目直接运行 VS2010 SP1 附带的模板。

请记住,我所做的是安装全新的 Windows 7 VM,然后立即安装 LightSwitch Beta 2。随后,我添加了 VS2010 Premium,并应用了 Service Pack 1。

模板应用程序的客户端部分启动了三个警告和两个错误;详细信息发布在下面。它在生成到 Web.g.vb(和 Web.g.cs)文件的代码中寻找找不到的 WebContextBase 类。到目前为止,这个项目完全是根据解决方案模板生成的;我没有在 VS2010 生成的内容中添加一行代码。

此后,我已经让 EF4 在 WinForms 项目和 Light Switch 项目中正常工作。

这是怎么回事?我该如何解决?


------ 构建已开始:项目:EF4Test,配置:调试任何 CPU ------ C:\Users\Rob\Documents\Visual Studio 2010\项目\EF4Test\EF4Test\生成_代码\EF4Test.Web.g.vb(21) :警告 BC40056:命名空间或类型 进口中指定 '系统.ServiceModel.DomainServices' 不包含任何公共成员或 找不到。确保 命名空间或类型已定义并且 包含至少一名公共成员。 确保导入的元素名称 不使用任何别名。 C:\Users\Rob\Documents\Visual Studio 2010\项目\EF4Test\EF4Test\生成_代码\EF4Test.Web.g.vb(22) :警告 BC40056:命名空间或类型 进口中指定 '系统.ServiceModel.DomainServices.Client' 不包含任何公共成员或 找不到。确保 命名空间或类型已定义并且 包含至少一名公共成员。 确保导入的元素名称 不使用任何别名。 C:\Users\Rob\Documents\Visual Studio 2010\项目\EF4Test\EF4Test\生成_代码\EF4Test.Web.g.vb(23) :警告 BC40056:命名空间或类型 进口中指定 'System.ServiceModel.DomainServices.Client.ApplicationServices' 不包含任何公共成员或 找不到。确保 命名空间或类型已定义并且 包含至少一名公共成员。 确保导入的元素名称 不使用任何别名。 C:\Users\Rob\Documents\Visual Studio 2010\项目\EF4Test\EF4Test\生成_代码\EF4Test.Web.g.vb(34) :错误 BC30002:类型“WebContextBase” 没有定义。 C:\Users\Rob\Documents\Visual Studio 2010\项目\EF4Test\EF4Test\Generate_Code\EF4Test.Web.g.vb(65) :错误 BC30451:“WebContextBase”是 未声明。可能无法访问 由于其保护级别。


I'm beginning my first explorations into Silverlight RIAs and EF4, but I can't get a project to run right off the templates that ship with VS2010 SP1.

Bear in mind here that what I've done is to install a brand new Windows 7 VM, and then I immediately installed LightSwitch Beta 2. Following that, I added VS2010 Premium, and applied Service Pack 1 to that.

The client portion of the Template app is kicking off three warnings and two errors; the details are posted below. It's looking for a WebContextBase class that it can't find, in code that it generated into Web.g.vb (and Web.g.cs) files. So far this project is entirely generated off the solution template; I haven't added a single line of code to what VS2010 generated.

I've since gotten EF4 to work fine in WinForms projects and Light Switch projects.

What's going on here, and how do I fix it?


------ Build started: Project: EF4Test, Configuration: Debug Any CPU
------ C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(21)
: warning BC40056: Namespace or type
specified in the Imports
'System.ServiceModel.DomainServices'
doesn't contain any public member or
cannot be found. Make sure the
namespace or the type is defined and
contains at least one public member.
Make sure the imported element name
doesn't use any aliases.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(22)
: warning BC40056: Namespace or type
specified in the Imports
'System.ServiceModel.DomainServices.Client'
doesn't contain any public member or
cannot be found. Make sure the
namespace or the type is defined and
contains at least one public member.
Make sure the imported element name
doesn't use any aliases.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(23)
: warning BC40056: Namespace or type
specified in the Imports
'System.ServiceModel.DomainServices.Client.ApplicationServices'
doesn't contain any public member or
cannot be found. Make sure the
namespace or the type is defined and
contains at least one public member.
Make sure the imported element name
doesn't use any aliases.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(34)
: error BC30002: Type 'WebContextBase'
is not defined.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(65)
: error BC30451: 'WebContextBase' is
not declared. It may be inaccessible
due to its protection level.


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧时模样 2024-10-29 13:31:05

请查看 LightSwitch Beta 2 自述文件

LightSwitch 存在一些已知问题。根据您描述的设置系统的步骤,我猜测问题可能是因为

“2.1.1 Visual Studio 2010 用户或
Visual Studio 2010 SP1 Beta1 用户
必须安装 Visual Studio 2010 SP1
安装 Visual Studio 之前
LightSwitch Beta2"

您应该尝试卸载 LightSwitch Beta2,然后重新安装,如果您遇到相同的错误,请告诉我们。

希望这会有所帮助。

Have a look at LightSwitch Beta 2 Readme

There are few know issues with the LightSwitch. From the steps you have described to setup your system I would guess that the problem could be because

"2.1.1 Visual Studio 2010 users or
Visual Studio 2010 SP1 Beta1 users
must install Visual Studio 2010 SP1
before installing Visual Studio
LightSwitch Beta2"

You should try uninstalling LightSwitch Beta2 and then reinstall, and let us know if you get the same error.

Hope this helps.

怪我太投入 2024-10-29 13:31:05

包括这个参考..
System.ServiceModel.DomainServices.Client.ApplicationServices

Include this reference..
System.ServiceModel.DomainServices.Client.ApplicationServices

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文