0

我在 monodevelop(版本 3.05)中编写了一个 hello world 应用程序并尝试在模拟器上运行它。程序编译成功,但是当我尝试运行它时出现以下错误。

   Detecting installed packages


   Installing shared runtime


   Deployment failed. Internal error

我已经安装了所有先决条件。

    1. mono for Android
     2. mono framework
      3. gtk#
       4. Android SDK

我通过 SDK Manager 安装所有软件包

以下是代码。

 using System;

  using Android.App;
  using Android.Content;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS;

   namespace  myAndroid
    {
[Activity (Label = "myAndroid", MainLauncher = true)]
public class Activity1 : Activity
{
    int count = 1;

    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

        // Set our view from the "main" layout resource
        SetContentView (Resource.Layout.Main);

        // Get our button from the layout resource,
        // and attach an event to it
        Button button = FindViewById<Button> (Resource.Id.myButton);

        button.Click += delegate {
            button.Text = string.Format ("{0} clicks!", count++);
        };
    }
    }
         }

编辑:.Net 2.0 .Net 4.0 visual studio 2010 express 已经安装在我的电脑上。我在 Windows 7 上以管理员身份运行 Visual Studio 2005,但如果这是与权限相关的问题,monodevelop 不会为我提供以管理员身份运行的选项。

4

1 回答 1

1

我在 VS2010 和 VS2012 中也看到了这一点,主要原因是当项目未在解决方案属性中设置为部署时。

解决方案的属性窗口

如果删除了该部署标志,您将遇到该问题。

于 2012-12-04T17:24:18.460 回答