App.Xaml.cs splashscreen errors

Hi

When trying to build the solution, I’m getting many errors in VS :-

Error 1
The best overloaded method match for ‘Template.MainPage.MainPage(SplashScreen)’ has some invalid arguments

Error 2
Argument 1: cannot convert from ‘Windows.ApplicationModel.Activation.SplashScreen’ to ‘SplashScreen’

Error 3
The type or namespace name ‘MetroHelpers’ does not exist in the namespace ‘Prime31’ (are you missing an assembly reference?)

Error 4
‘SplashScreen’ does not contain a definition for ‘ImageLocation’ and no extension method ‘ImageLocation’ accepting a first argument of type ‘SplashScreen’ could be found (are you missing a using directive or an assembly reference?)

The solution however works just fine when compiling as D3D C++ or D3D C# so it looks like something to do with the way XAML works…

Thanks in advance for any help

Regards
Shashank

Hi,

did you by any chance export XAML project to the same folder as D3D project without deleting it first and mix-matching files in the result? If so, try building to a different folder or at least delete the contents of the first folder.

No, its a clean build into a different folder…

Which version of Unity do you use?

I’m using Unity 4.3.3f1 , Windows 8.1 , VS Express 2013

Does this also happen with an empty project?
Also, you can try to modify MainPage.cs to use full name for SplashScreen (Windows.ApplicationModel.Activation.SplashScreen).
Prime31 is external component, perhaps you don’t have reference to it in your VS project?

  • no , it doesn’t happen with an empty project
  • indeed, thanks, using the full qualifier for SplashScreen fixed it
  • commented out the Prime31 line also

But still its weird why we’ve to use the full qualifier when we are using the namespace at the top.

I’d guess you have something called SplashScreen somewhere in your project and it’s visible in App.cs. There’s no such thing in empty project, so it works fine without full qualifier.

1 Like

Thanks, indeed there was a script with the name SplashScreen clashing with the other one. Changing the name fixed it :slight_smile:

1 Like

Hi shashank, can you help me in this, im also facing the same isssue, but im not able to follow the steps mentioned

Fully qualified name is Windows.ApplicationModel.Activation.SplashScreen, use this instead of just SplashScreen in generated solution and it should compile. Other solution would be to find something called SplashScreen in your project and rename it.

Exactly!

I had the same problem too.
Simply adding a class called SplashScreen to an empty project (even without referencing it) does generate these errors.

1 Like