Xamarin.forms: Live Player Build Does Not Access Xamarin Namespace

Created on 28 Dec 2017  ·  42Comments  ·  Source: xamarin/Xamarin.Forms

Bug report best practices: https://github.com/xamarin/Xamarin.Forms/wiki/Submitting-Issues

Description

Creating a new CrossPlatform App does not build without errors when using Live Player.

Steps to Reproduce

  1. Use Visual Studio (currently 15.5.2) to create a new Cros-Platform App
  2. On template select Blank App (choose Platform iOS only, UI Tech Xamarin.Forms, and Code Sharing Strategy (either presents similar but slightly different errors).
  3. Creates App
  4. From shared project App, open MainPage.xaml.
  5. Select the 'Live Run' Option
  6. During the build the errors start

Expected Behavior

I expect to see the app execute

Actual Behavior

I get the following set of errors at a minimum:]

  • The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?) -- AppDelegate.cs (Line: 1)
  • The name 'LoadApplication' does not exist in the current context -- AppDelegate.cs (Line: 1)
  • 'AppDelegate.FinishedLaunching (UIApplicaton, NSDictionary)': no suitable method found to override -- AppDelegate.cs (Line: 1)
  • 'App.OnStart()': no suitable method found to override -- App.xaml.cs (Line: 1)
  • The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?) -- App.xaml.cs (Line: 1)
  • Other items
  • The iOS project's packages.config file shows an earlier version of "2.4.0.266-pre1". Could this have anything to do with it? I changed the number, but that did not seem to do anything different.
  • Where should the Xamarin.Forms Package items be installed for the app?
  • I've packaged the project for your review.

Basic Information

  • Version with issue: current
  • Last known good version: have not tried before
  • IDE: VS 2017 15.5.2
  • Platform Target Frameworks:

    • iOS: iOS 11.2.1

  • Nuget Packages: At solution level - Xamarin.Forms v2.5.0.121934

Screenshots

Reproduction Link

iOS 🍎 bug

All 42 comments

Same issue arose with the above configurations. Application can build successfully, but when try to connect to live player it gives errors,

iosliveplayerissues

Same here. I got this problem in VS2017, testing with my iPad mini 2.

Same here with VS2017 v15.5.2 and Xamarin.Forms v2.5.0.122203.
Going to try updating VS now, will report back if any news!

I am also Having same issue.

Sae problem on VS2017 15.5.6 with iPhone 6 11.2.5.

I have the same issue.

Same Issue VS 2017

Same Issue VS 2017 with iPhone 6 Plus

Same with iphone SE and VS2017,
and no - deleting .vs folders, clean build or delete bin/lib directories prior to build does change nothing, even as setting linking to SDKs only or No Linking has no effects.

Same issue here. just want to provide some more details about the issue.

I have Visual Studio Enterprise 2017 Version 15.5.6 with

  • Xamarin - 4.8.0.760;
  • Xamarin Design - 4.8.188;
  • Xamarin.Android SDK - 8.1.5.0;
  • Xamarin.iIS and Xamarin.Mac SDK - 11.6.1..4

Xamarin Live Player app downloaded from iOS App Store is version 1.0.252, it is running on iPhone X (iOS 11.2.5)

Procedure

Created a default new Cross-platform with Xamarin Forms, and .NET Standard, after the project creation, updated the Xamarin package with NuGet. Xamarin.Forms is v2.5.0.280555.
Xamarin Live Player (from iOS App Store) version is 1.0.252

Able to build and deploy to Android Xamarin live player, and also to debug on it.
But Cannot build or deploy to iOS Xamarin Live Player.

Error Message from VS 2017 Output:

Start (App1.iOS, iPhoneX Player, ).
Attempting connection to debug address: 192.168.0.11:37847.
Connected to: 192.168.0.11:37847.
Deploying C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1.iOS\App1.iOS.csproj...
Got device info: iPhoneX Player (iOS) @ 192.168.0.11:37847
Synchronizing files...
Building and running...
Built with 18 messages.
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\App.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\MainPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\App.xaml.cs(1,1): error: The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)
(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\MainPage.xaml.cs(1,1): error: The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?)
(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\App.xaml.cs(1,1): error: 'App.OnStart()': no suitable method found to override
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\App.xaml.cs(1,1): error: 'App.OnSleep()': no suitable method found to override
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\App.xaml.cs(1,1): error: 'App.OnResume()': no suitable method found to override
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1.iOS\AppDelegate.cs(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1.iOS\AppDelegate.cs(1,1): error: 'AppDelegate.FinishedLaunching(UIApplication, NSDictionary)': no suitable method found to override
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1\App.xaml.cs(1,1): error: 'MainPage' is a type but is used like a variable
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1.iOS\AppDelegate.cs(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
C:\Users\dev\Documents\Visual Studio 2017\Projects\App1\App1\App1.iOS\AppDelegate.cs(1,1): error: The name 'LoadApplication' does not exist in the current context
(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
Failed to debug your app.

Same here, Visual Studio 2017 15.5.7

Same Issue Visual Studio 2017 15.5.7

I confirm for VS 2017 15.5.7.


From: shbhsu notifications@github.com
Sent: Sunday, February 25, 2018 10:57 AM
To: xamarin/Xamarin.Forms
Cc: amihailes; Comment
Subject: Re: [xamarin/Xamarin.Forms] Live Player Build Does Not Access Xamarin Namespace (#1475)

Same Issue Visual Studio 2017 15.5.7


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/xamarin/Xamarin.Forms/issues/1475#issuecomment-368296942, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQqQjAFWyQukHkfWElSndA33ulQ5q9neks5tYS6bgaJpZM4ROcDf.

Confirming for VS2017 15.6 and 7.4 (OSX)

I have the same issue VS Enterprise 2017 15.6.2 - Xamarin Forms 2.5.0.280555 - Win 10 Pro - iPhone 7

Today received an email from Microsoft, James Montemagno, Program Manager, Mobile Developer Tools, about the Xamarin Live Player, and I have send him this issue thread, hope this issue will be addressed sooner.

====Below is the email that I received ====
Hello!

My name is James Montemagno, and I am a Program Manager on the Mobile Developer Tools team at Microsoft. I am reaching out to you because you previously gave the Xamarin Live Player for iOS and Android a try and I would love to hear your feedback.

If you could take a couple of minutes to tell us about your experience by responding to this short survey, I would really appreciate it. The information you provide is entirely voluntary and will only be used internally to help improve the Xamarin Live Player in the future. If you prefer to not participate, you may simply ignore this email.

I hope to hear from you soon!

James Montemagno
Program Manager, Mobile Developer Tools
[email protected]

Please use the Test Flight version for iOS as it is compatible with the latest and greatest: https://aka.ms/liveplayeralpha

Thank you @jamesmontemagno I was having this issue, downloaded the testflight version and works like a charm...appreciate all your work and sharing!

Thank you @jamesmontemagno. This issue is gone. But now I retrieve a Visualization Error: Assembly must be a runtime object. (ArgumentException)

I would recommend trying some fresh templates first and going through the samples:
https://developer.xamarin.com/getting-started/
https://developer.xamarin.com/samples/xamarin-live-player/all/

You could be hitting other limitations that can't be interpreted.
I am going to close this issue now that I have posted a solution.

Still having this issue with preview 2 that was released the other day james so it has not found its way into the normal build yet this fix

My question on stack

https://stackoverflow.com/questions/49340872/issue-compiling-a-fresh-blank-net-app-shared-project

send me the project.

@jamesmontemagno You are a life saver. Installing the Live Player Beta fixes this issue in VS2017 Pro 15.6.2 - thank you!

However live refresh doesn't work even after saving the .xaml file. I have to stop debugging and restart in order to see my changes on the iPhone.

It also doesn't work with Telerik. Now I get "The type or namespace 'Telerik' could not be found in the global namespace" and the reference is definitely on the ios project.

What I was saying the test flight fixed the issue but looks like the fix has not made its way into the new build of visual studio james.

Sent from my iPhone

On 17 Mar 2018, at 20:29, Ready2Burst notifications@github.com wrote:

@jamesmontemagno You are a life saver. Installing the Live Player Beta fixes this issue in VS2017 Pro 15.6.2 - thank you!


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Hi James I was wrong the app did not build and it still fails with entity
framework core and sql lite installed maybe something simple I am doing
wrong here is the app.

I just starting to build my db context etc and it wont deploy to a 6 se.

https://github.com/davidbuckleyni/Appointments

On Sat, Mar 17, 2018 at 8:53 PM, David Buckley davidbuckleyweb@gmail.com
wrote:

What I was saying the test flight fixed the issue but looks like the fix
has not made its way into the new build of visual studio james.

Sent from my iPhone

On 17 Mar 2018, at 20:29, Ready2Burst notifications@github.com wrote:

@jamesmontemagno https://github.com/jamesmontemagno You are a life
saver. Installing the Live Player Beta fixes this issue in VS2017 Pro
15.6.2 - thank you!


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/1475#issuecomment-373950270,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFW-He60qivuO1VT9s3KUPrS8vB5D3Qjks5tfXIRgaJpZM4ROcDf
.

--

Regards
David Buckley
M: 07706 649134
T:02893 345 055

Ah yeah, we have open bugs against additional NuGets that are not compatible. Think of the live player as more of a getting started and rapid prototyping tool for user interfaces.

Just don’t have a mac so was fingers crossed could use this then no update yet when this might be fixed

Sent from my iPhone

On 17 Mar 2018, at 23:13, James Montemagno notifications@github.com wrote:

Ah yeah, we have open bugs against additional NuGets that are not compatible. Think of the live player as more of a getting started and rapid prototyping tool for user interfaces.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

If you setup your app in a way that calls into mock data and not try to actually use those libraries (which I recommend) then it will play a lot nicer. We can't interpret code like that unfortunatelly :( We have a longer on some things that I can't talk about for production apps with crazy dependencies.

I am from the uk Love watching your videos on channel 9 tinkered now and again in xamrian and love the concept but would be great a day when we mac independent

You will always need a mac and will want one anyways for real production applications at some point, even a mac mini. The Live Player really is to facilitate that first week and getting started without one for sure though and that was our goal. The problem is that at some point you need to compile and put it on a sim or install on device.

If you are using Forms then focus on the Android side of things and when ready your app basically will be good to go on iOS.

@Ready2Burst You have to put it in Live Run Current View Mode. Simply right click on the xaml and say live run. There are two modes.

Yeah will do that ano would Never see a day mac and win smile together

@jamesmontemagno Thanks that works! However, any idea what would cause Telerik to not work with Live Player? Is that just not compatible?

I really appreciate your time, especially since its Saturday!

Correct, most third party libraries aren't going to be compatible as they usually have code that needs interpreting or other circumstances. Think of the live player as more of a getting started and rapid prototyping tool for user interfaces.

Makes sense, thanks for the confirmation. I wasn't sure if the compilation would just work with third party assemblies or not.

We aren't compiling anything and interpret everything which is why .

Makes total sense. This is really a great tool! It will save everyone considerable amounts of time during dev. Thank you!

James is there a way to Sync a sql 2014 db yet to sql lite with sql lite or is web services still considered the better way to go for the future.

I miss parse.com and the simplicity of it was great just find azure to be very expensive for a solo developer

@jamesmontemagno Is there a list of supported functionality for Live Player? I can't get PCL images to appear via xaml nor code behind and I've tried every example out there. They work fine when building and deploying the iOS app directly to the phone, so I assume embedded resource images in PCL aren't supported?

@jamesmontemagno we are building our app on mac and we think we are experiencing a similar bug people reported here. We have a simple Xamarin app and we want to debug it on live player (on a samsung s9)... the app has one page and the page uses a resx file, if we try to read the resource file in the mainPage.xaml.cs to simply send a text to a label property as
this.txtMail.Placeholder = AppResources.txtMail_Placeholder_MainPage;
, this message appears:
Visualization Error: Assembly must be a a runtime Assembly object

debugging a bit more we think the error comes from the resx designer.cs... and precisely here
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("testapp.resources.AppResources", typeof(AppResources).Assembly);

if we comment the
this.txtMail.Placeholder = AppResources.txtMail_Placeholder_MainPage;
all is working .....

can you give us a hint to solve this situation?

thank you very much

Any solution...?

Was this page helpful?
0 / 5 - 0 ratings