Dropbox.API Nuget 更新到 3.0.1 在 ASP.Net MVC 5 视图上为 System.Object 提供了 CS0012 编译错误
Dropbox.API Nuget update to 3.0.1 gives CS0012 compilation error for System.Object on ASP.Net MVC 5 view
我将 Dropbox.API Nuget 包从 2.3.6 更新到 3.0.1,现在出现错误
The type System.Object is defined in an assembly that is not referenced. You must add a reference to assembly System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
以下在错误来源下标记为红色,但这不是我的代码
Line 31: public class _Page_Views_Dropbox_Index_cshtml : System.Web.Mvc.WebViewPage {
我在更新前用 2.3.6 测试了 运行 代码,一切正常。
编译信息框说
Microsoft (R) Visual C# Compiler version 4.6.1038.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
虽然我有 .Net 4.6.1 作为目标框架。
这是 Dropbox 软件包中的错误吗,所以我应该降级直到他们修复它,或者我需要更改与 MembersListResult
相关的代码吗?
更新
Dropbox 现在已经通过更新包版本 3.0.2 解决了这个问题。
我找到了以下信息http://www.lyalin.com/2014/04/25/the-type-system-object-is-defined-in-an-assembly-that-is-not-reference-mvc-pcl-issue/
我尝试在 <assemblies>
下仅添加 <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
。我跳过添加 <compilation debug="true" targetFramework="4.5">
,因为这感觉与我未使用的旧框架有关。
它现在可以工作了,但是从微软那里读到这篇文章后,看起来 Dropbox 在编译 Nuget 包时做错了什么 https://support.microsoft.com/en-us/kb/2971005
我将 Dropbox.API Nuget 包从 2.3.6 更新到 3.0.1,现在出现错误
The type System.Object is defined in an assembly that is not referenced. You must add a reference to assembly System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
以下在错误来源下标记为红色,但这不是我的代码
Line 31: public class _Page_Views_Dropbox_Index_cshtml : System.Web.Mvc.WebViewPage {
我在更新前用 2.3.6 测试了 运行 代码,一切正常。
编译信息框说
Microsoft (R) Visual C# Compiler version 4.6.1038.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
虽然我有 .Net 4.6.1 作为目标框架。
这是 Dropbox 软件包中的错误吗,所以我应该降级直到他们修复它,或者我需要更改与 MembersListResult
相关的代码吗?
更新 Dropbox 现在已经通过更新包版本 3.0.2 解决了这个问题。
我找到了以下信息http://www.lyalin.com/2014/04/25/the-type-system-object-is-defined-in-an-assembly-that-is-not-reference-mvc-pcl-issue/
我尝试在 <assemblies>
下仅添加 <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
。我跳过添加 <compilation debug="true" targetFramework="4.5">
,因为这感觉与我未使用的旧框架有关。
它现在可以工作了,但是从微软那里读到这篇文章后,看起来 Dropbox 在编译 Nuget 包时做错了什么 https://support.microsoft.com/en-us/kb/2971005