Sha*_*awn 10 xamarin.ios xamarin.android xamarin xamarin.forms
我在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
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init ();
LoadApplication (new MyApp.App ());
//Error on above line in MyApp.App ()
return base.FinishedLaunching (app, options);
}
}
}
Run Code Online (Sandbox Code Playgroud)
这个解决方案刚刚完成,还没有完成编码,这可能是VS2015的一个问题吗?
sil*_*age 18
这是一个仍然存在的问题.虽然这可能不是7月份的解决方案,但这是3/31/16的工作解决方案.
在打开XAML文件并切换回PCL项目中的C#文件后,有时也会发生这种情况.
| 归档时间: |
|
| 查看次数: |
9399 次 |
| 最近记录: |