【问题标题】:VS2012 and INotifyPropertyChangedVS2012 和 INotifyPropertyChanged
【发布时间】:2013-06-18 14:31:44
【问题描述】:

在 Windows 7 上将我的项目从 Xamarin Studio 移植到 VS2012 时出现错误

错误 3 类型“System.ComponentModel.INotifyPropertyChanged”是 在未引用的程序集中定义。您必须添加一个 参考程序集 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'。 C:\Users\user\Documents\Visual Studio 2012\Projects\MyProject.Core\ApplicationObjects\AppStart.cs

这是我的 AppStart.cs:

using Cirrious.MvvmCross.ViewModels;
using MyProject.Core.ViewModels;

namespace MyProject.Core.ApplicationObjects
{
    public class AppStart
        : MvxNavigatingObject
          , IMvxAppStart
    {
        private readonly bool _showSplashScreen;

        public AppStart(bool showSplashScreen)
        {
            _showSplashScreen = showSplashScreen;
        }

        public void Start(object hint = null)
        {
            if (_showSplashScreen)
            {
                ShowViewModel<SplashScreenViewModel>();
            }
            else
            {
                ShowViewModel<HomeViewModel>();
            }
        }
    }
}

我的核心项目在 Mac 上编译良好。

【问题讨论】:

    标签: visual-studio-2012 xamarin mono mvvmcross portable-class-library


    【解决方案1】:

    猜测您正在使用 Mac 构建的程序集在 PC 上构建。

    使用 Xamarin Studio 在 Mac 上构建的 PCL 程序集不是真正的可移植类库 - 相反,它们是针对 MonoTouch/Droid 程序集(传统上更接近 Silverlight 而不是正确的 .Net)构建的普通程序集

    https://github.com/slodge/MvvmCross-Binaries/ 上的 Binaries Repo 提供 Mac 和 PC 预构建程序集,以便更轻松地在两者之间切换

    这种情况现在很复杂,因为 Xamarin 还没有对 PCL 的支持 - 但它会在接下来的 2 周内推出。

    此外,如果您要切换到 PC 进行开发,那么现在可以通过 http://mvvmcross.wordpress.com 获得许多示例,这些示例展示了如何使用 Nuget 在 PC 上完成所有开发

    【讨论】:

      【解决方案2】:

      解决了在我的情况下在C:\Windows\Microsoft.NET\Framework\vx.... 上引用System.ObjectModel.dll v4.0.30319 32bits

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-17
        • 2011-06-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多