0

Hope someone can give me some hints of my problem.
I'm starting with a blank "App Universal Windows" (UWP).
I'm upgrade to the latest "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
I'm using Nuget to install Prism and selecting the Prism.Unity v6.3.0-pre1. (I have also tried the 6.2 with the same symptom.)

Changeing the App.xaml.cs to:

using System.Threading.Tasks;
using Windows.ApplicationModel.Activation;
using Microsoft.Practices.Unity;
using Prism.Unity.Windows;

namespace Bituc
{
    sealed partial class App : PrismUnityApplication
    {
        public App()
        {
            this.InitializeComponent();
        }

        protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
        {
            NavigationService.Navigate("Main", null);
            return Task.FromResult<object>(null);
        }
}    }    }

This gives me this complie errors:
Error CS0263 Partial declarations of 'App' must not specify different base Error CS0115 'App.OnLaunchApplicationAsync(LaunchActivatedEventArgs)': no suitable method found to override.
Error CS0103 The name 'NavigationService' does not exist in the current context.

This is my project.json file:

"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2",
"Prism.Unity": "6.3.0-pre1"},
"frameworks": {"uap10.0": {}},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}

What am i missing? Thank's for any suggestions.
Greg

Greg
  • 25
  • 3

1 Answers1

1

Does your App.xaml look like this?

<Application x:Class="BorealDesigner.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
...
</Application>

If so, also change Application to PrismUnityApplication, as that's what the error message tells you: if you define a class in two files, you cannot have it derive from Application in one file but PrismUnityApplication in the other.

BTW, probably lesser known fact: you need only one of the class declaration files to state the base class. The typical : UserControl you find in the code behind is superfluous...

Haukinger
  • 10,420
  • 2
  • 15
  • 28