我在Visual Studio 2015中遇到了一个新制作的Xamarin.Forms应用程序的问题.我将Droid/iOS项目添加到解决方案中,它给了我一个构建错误,说...
The type or namespace 'App' does not exist in the current namespace
以下是两个错误的位置示例.
Droid项目:
namespace MyApp.Droid
{
[Activity (Label = "MyApp", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
global::Xamarin.Forms.Forms.Init (this, bundle);
LoadApplication (new MyApp.App ());
//Error on the above line at MyApp.App ()
}
}
}
Run Code Online (Sandbox Code Playgroud)
iOS项目:
namespace MyApp.iOS
{
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{ …Run Code Online (Sandbox Code Playgroud)