相关疑难解决方法(0)

"System.IDisposable"类型在未引用的程序集中定义

我在Windows 8上的Visual Studio 2012中创建了一个Windows窗体应用程序,目标.NET框架是4.5,我想使用Windows SDK的Datagramsocket库,因此我在编译时将目标操作系统版本更改为8.

我收到以下错误:

"错误1类型'System.IDisposable'在未引用的程序集中定义.您必须添加对程序集'System.Runtime,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'的引用."

.net c# windows

30
推荐指数
3
解决办法
2万
查看次数

运行时编译错误来自Microsoft.AspNet.WebApi.HelpPage版本4.0.30506

当我尝试使用版本4.0.30506(不幸的是我们现在绑定到此版本的ASP.NEt Web API)的Microsoft.AspNet.WebApi.HelpPage nuget包时,我收到以下错误.我使用的是Windows 7和.NET 4.5.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0012: 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'.

Source Error:


Line 11: 
Line 12:     // Group APIs by controller
Line 13:     ILookup<string, ApiDescription> apiGroups = …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-mvc razor

20
推荐指数
1
解决办法
5976
查看次数

Asp.net MVC EditorFor"类型'System.Object'是在未引用的程序集中定义的"错误

@using (Html.BeginForm("Index", "Employees", FormMethod.Post, new { encType = "multipart/form-data", name = "EmployeeForm" }))
{
<table class="table table-bordered table-condensed table-striped">
    <tr>
        <th>
            Name
        </th>
        <th>
            Surname
        </th>
        <th>
            ID Number
        </th>
        <th>
            Email
        </th>
        <th>
            Birthdate
        </th>
        <th>
            Action
        </th>
    </tr>
    @Html.EditorFor(model => model.Employees)
</table>
}
Run Code Online (Sandbox Code Playgroud)

第32行:@ Html.EditorFor(model => model.Employees)给出以下错误

CS0012: 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'.
Run Code Online (Sandbox Code Playgroud)

我在另一个没有出现此错误的项目中使用了这种类似的方法.

c# asp.net asp.net-mvc razor asp.net-mvc-4

5
推荐指数
1
解决办法
5060
查看次数

标签 统计

asp.net ×2

asp.net-mvc ×2

c# ×2

razor ×2

.net ×1

asp.net-mvc-4 ×1

windows ×1