[英]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.