简体   繁体   English

错误 CS0234 命名空间“MvvmCross”中不存在类型或命名空间名称“平台”(您是否缺少程序集引用?)

[英]Error CS0234 The type or namespace name 'Platforms' does not exist in the namespace 'MvvmCross' (are you missing an assembly reference?)

Hi I'm newbie in MvvmCross framework and Xamarin.Android development,嗨,我是 MvvmCross 框架和 Xamarin.Android 开发的新手,

I try to follow the TipCalc Android Project tutorial https://www.mvvmcross.com/documentation/tutorials/tipcalc/a-xamarinandroid-ui-project via this link我尝试通过此链接遵循 TipCalc Android 项目教程https://www.mvvmcross.com/documentation/tutorials/tipcalc/a-xamarinandroid-ui-project

However, after I created the Core project, and added the "MainApplication.cs" to the Android Project in the solution (Installed both MvvmCross version 7.2).但是,在我创建了 Core 项目并将“MainApplication.cs”添加到解决方案中的 Android 项目之后(安装了 MvvmCross 7.2 版)。 I cannot reference Platforms package inside MvvmCross.我无法在 MvvmCross 中引用 Platforms 包。

It gives me the error,它给了我错误,

Error CS0234 The type or namespace name 'Platforms' does not exist in the namespace 'MvvmCross' (are you missing an assembly reference?)错误 CS0234 命名空间“MvvmCross”中不存在类型或命名空间名称“平台”(您是否缺少程序集引用?)

This should be a simple app tutorial but it has been making me stuck for 2 days.这应该是一个简单的应用程序教程,但它让我卡住了 2 天。 Does anyone have an idea?有没有人有想法?

MainApplication.cs主应用程序.cs

using System;
using Android.App;
using Android.Runtime;
// These next 2 aren't found
using MvvmCross.Platforms.Android.Core;
using MvvmCross.Platforms.Android.Views;
using TipCalc.Core;

namespace TipCalc.Droid
{
    [Application]
    // So this MvxAndroid... is also not found
    public class MainApplication : MvxAndroidApplication<MvxAndroidSetup<App>, App>
    {
        public MainApplication(IntPtr javaReference, JniHandleOwnership transfer)
            : base(javaReference, transfer)
        {
        }
    }
}

I added MvvmCross as an assembly reference, but these namespaces aren't showing up.我添加了MvvmCross作为程序集引用,但这些命名空间没有出现。 What's going wrong here?这里出了什么问题?

Recently the mvvmcross namespaces were changed最近更改了 mvvmcross 命名空间

it shows that MvvmCross.Platform was changed to MvvmCross它表明 MvvmCross.Platform 已更改为 MvvmCross

the changelog 变更日志

If you are updating an old solution, make sure you change your Android Application project to target Android 10. Otherwise the NuGet package won't install properly for the Android Application.如果您要更新旧解决方案,请确保将您的 Android 应用程序项目更改为面向 Android 10。否则将无法为 Android 应用程序正确安装 NuGet 包。 If you are still using packages.config, you may have to uninstall the packages and install them again after changing target.如果您仍在使用packages.config,您可能需要卸载软件包并在更改目标后重新安装它们。

You can reference the TipCalc sample here: https://github.com/MvvmCross/MvvmCross-Samples/tree/master/TipCalc您可以在此处参考 TipCalc 示例: https : //github.com/MvvmCross/MvvmCross-Samples/tree/master/TipCalc

Although the reece was correct when there was a codebase change for version 6.0.0 of MvvmCross, the actual solution to my problem, in order to get the tutorial to work is downgrading MvvmCross package in Nuget to 6.2.1 .尽管当 MvvmCross 的 6.0.0 版代码库发生更改时,reece 是正确的,但我问题的实际解决方案是将 Nuget 中的 MvvmCross 包降级到 6.2.1 I haven't tested with any other versions but 6.2.1 worked for me.我没有用任何其他版本测试过,但 6.2.1 对我有用。

暂无
暂无

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

相关问题 错误 CS0234 命名空间“Microsoft”中不存在类型或命名空间名称“Reporting”(您是否缺少程序集引用?) - Error CS0234 The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (Are you missing an assembly reference?) 错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(您是否缺少程序集引用?) - error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) CS0234 C#类型或名称空间名称&#39;Slydeextender&#39;在名称空间中不存在(您是否缺少程序集引用?) - CS0234 C# The type or namespace name 'Slydeextender' does not exist in the namespace (are you missing an assembly reference?) 错误CS0234:类型或名称空间名称&#39;OAuth&#39;在名称空间&#39;Microsoft.Owin.Security&#39;中不存在(您是否缺少程序集引用?) - error CS0234: The type or namespace name 'OAuth' does not exist in the namespace 'Microsoft.Owin.Security' (are you missing an assembly reference?) VS 2017 c#错误CS0234命名空间中不存在类型或命名空间名称(您是否缺少程序集引用?) - VS 2017 c# Error CS0234 The type or namespace name does not exist in the namespace (are you missing an assembly reference?) 编译器错误消息:CS0234:命名空间“传真”中不存在类型或命名空间名称“WebApp”(您是否缺少程序集引用?) - Compiler Error Message: CS0234: The type or namespace name 'WebApp' does not exist in the namespace 'Fax' (are you missing an assembly reference?) CS0234:命名空间“<namespace1>”中不存在类型或命名空间名称“<namespace2>”。 (你错过了一个程序集引用吗?) - CS0234: The type or namespace name '<namespace2>' does not exist in the namespace '<namespace1>.' (are you missing an assembly reference?) CS0234:类型或名称空间名称“ Description”在名称空间“ System.Web.Http”中不存在(您是否缺少程序集引用?) - CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?) MEF CS0234:名称空间&#39;System.ComponentModel&#39;中不存在类型或命名空间名称&#39;Composition&#39;(您是否缺少程序集引用?) - MEF CS0234: The type or namespace name 'Composition' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?) CS0234:类型或名称空间名称“ WebPages”在名称空间“ System.Web”中不存在(您是否缺少程序集引用?) - CS0234: The type or namespace name 'WebPages' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM