简体   繁体   English

在UWP失败中安装MVVMCross插件

[英]Install MVVMCross plugin in UWP failure

i am trying to install MVVMCross plugin in UWP project but it seems to fail. 我试图在UWP项目中安装MVVMCross插件,但似乎失败。
in the PCL it seems to be working fine, but in the UWP I'm expecting that the plugin will create a Bootstrap folder and it doesn't happen. 在PCL中,它似乎工作正常,但是在UWP中,我期望该插件将创建一个Bootstrap文件夹,并且不会发生。

I even started a new project from scratch named it "TipCalc.WindowsUWP", installed the MVVMCross and then the JSON plugin using NuGet and nothing happens. 我什至从头开始了一个名为“ TipCalc.WindowsUWP”的新项目,安装了MVVMCross,然后使用NuGet安装了JSON插件,但没有任何反应。

the output of the plugin installation looks fine: 插件安装的输出看起来不错:

Restoring packages for 'TipCalc.WindowsUWP'.
Restoring packages for C:\Users\kayce\Documents\Visual Studio 2015\Projects\TenBisServer\MvvmCross\TipCalc\TipCalc.WindowsUWP\project.json...
Package restore completed successfully for 'TipCalc.WindowsUWP'.
Successfully installed 'MvvmCross.Plugin.Json 4.2.3' to TipCalc.WindowsUWP
========== Finished ==========

what I am missing ? 我想念什么?

This is expected behavior, as a UWP project uses a project.json (NuGet 3) template. 这是预期的行为,因为UWP项目使用project.json(NuGet 3)模板。 Currently all additional content and scripting specified in the NuGet package with have no affect on your project when including a package (See Changes affecting existing packages ). 当前,NuGet软件包中指定的所有其他内容和脚本在包含软件包时都不会影响您的项目(请参阅影响现有软件包的更改 )。

You will have to manually add the bootstrap folder and relevant plugin bootstrap .cs file, or you can register the interface and implementation of the plugin in your Setup.cs . 您将必须手动添加bootstrap文件夹和相关的插件bootstrap .cs文件,或者可以在Setup.cs注册插件的接口和实现。

Bootstrap Approach: 引导方法:

using MvvmCross.Platform.Plugins;

namespace <<YOUR_NAMESSPACE>>.Bootstrap
{
    public class JsonPluginBootstrap
        : MvxPluginBootstrapAction<MvvmCross.Plugins.Json.PluginLoader>
    {
    }
}

Setup.cs Approach: Setup.cs方法:

protected override void InitializeLastChance()
{
        base.InitializeLastChance();
        Mvx.RegisterSingleton<IMvxJsonConverter>(new MvxJsonConverter());
}

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM