简体   繁体   English

错误 MC3066:类型引用找不到名为“StoreDb”的公共类型。 9号线 Position 94

[英]error MC3066: The type reference cannot find a public type named 'StoreDb'. Line 9 Position 94

I download the source code of book from github here .我在这里从 github 下载本书的源代码。

I am building DataBinding project in chapter 19 but it doesn't build and I get this compilation error.我正在第 19 章中构建 DataBinding 项目,但它没有构建,并且出现此编译错误。

error MC3066: The type reference cannot find a public type named 'StoreDb'.错误 MC3066:类型引用找不到名为“StoreDb”的公共类型。 Line 9 Position 94.第 9 行 Position 94。

<Window x:Class="DataBinding.BindToObjectDataProvider"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="BindToObjectDataProvider" Height="450" Width="400"
    xmlns:data="clr-namespace:StoreDatabase;assembly=StoreDatabase" 
    >
  <Window.Resources>
    <ObjectDataProvider ObjectType="{x:Type data:StoreDb}"                         
                       MethodName="GetProductsSlow" x:Key="products" IsAsynchronous="True"></ObjectDataProvider>
  </Window.Resources>

Can anyone see why it doesn't build?谁能看到它为什么不建立? Thank you!谢谢!

I am using Visual Studio 2019.我正在使用 Visual Studio 2019。

I had copied the chapter 19 folder (where the project was) to another folder to build/run/play with so I don't modify the original but it required StoreDatabase project which was in root folder.我已将第 19 章文件夹(项目所在的位置)复制到另一个文件夹以进行构建/运行/播放,因此我没有修改原始文件夹,但它需要根文件夹中的 StoreDatabase 项目。

I tried to build the project on another PC that gave me a clue, it had an error that one project was not loaded.我试图在另一台给我线索的 PC 上构建项目,但出现一个项目未加载的错误。 Copied that project to root fixed it.将该项目复制到根修复它。

This was the error loading solution.这是错误加载解决方案。

C:\Projects\StoreDatabase\StoreDatabase.csproj: error: The project file could not be loaded. C:\Projects\StoreDatabase\StoreDatabase.csproj: 错误:无法加载项目文件。 Could not find a part of the path 'C:\Projects\StoreDatabase\StoreDatabase.csproj'.找不到路径“C:\Projects\StoreDatabase\StoreDatabase.csproj”的一部分。 C:\Projects\StoreDatabase\StoreDatabase.csproj C:\Projects\StoreDatabase\StoreDatabase.csproj

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型引用找不到命名的公共类型 - Type reference cannot find public type named WPF自定义控件中的“类型引用找不到公共类型...”错误 - “The type reference cannot find a public type…” error in WPF Custom Control WPFToolkit:类型引用找不到公共类型 - WPFToolkit : Type reference cannot find a public type 类型引用找不到名为命令的类型 - Type reference cannot find type named Commands 类型引用找不到命名类型……不是因为缺少程序集名称 - Type reference cannot find type named… NOT because of missing assembly name 为什么我在这个数据绑定上得到“类型引用无法找到公共类型”? - Why do I get “type reference cannot find a public type” on this databinding? 类型引用在MergedDictionary上找不到名为&#39;{clr-namespace:xxx} ClassName的类型 - Type reference cannot find type named '{clr-namespace:xxx}ClassName on MergedDictionary 修复错误:无法通过表达式引用类型 - Fixing error: cannot reference a type through an expression 如何修复错误 MC1000 未知构建错误,“找不到类型”System.Web.UI.TagPrefixAttribute” - How to fix error MC1000 Unknown build error, 'Could not find type 'System.Web.UI.TagPrefixAttribute' 无法保存参考类型 - Cannot save reference type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM