Ich habe Namespaces Fehler in ASP.Net MVC WebAPI. Ich benutze MVC 4 mit .Net Framework 4.5, während die Anwendung läuft Es funktioniert aber auf den Klick der API zeigt Fehler wie unten.CS0234: Der Typ oder Namespacename 'Beschreibung' existiert nicht im Namespace 'System.Web.Http' (fehlt eine Assemblyreferenz?)
------------------------------------------------------------------------------------
Server Error in '/' Application.
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: CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
Source Error:
Line 1: @using System.Web.Http
Line 2: @using System.Web.Http.Description
Line 3: @using System.Collections.ObjectModel
Line 4: @using SmartCare360APIs.Areas.HelpPage.Models
Source File: e:\Projects\SmartCare 360\Code\SmartCare360APIs\SmartCare360APIs\Areas\HelpPage\Views\Help\Index.cshtml Line: 2
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1637.0
-----------------------------------------------------------------------------------
Unten ist der Name Namespace fehlt. Ich habe versucht, mvc 4 neu zu installieren, aber es kommt mit viel mehr Fehler.
Page : **ApiGroup.cshtml**
@using System.Web.Http
@using System.Web.Http.Description
@using SmartCare360APIs.Areas.HelpPage
@using SmartCare360APIs.Areas.HelpPage.Models
@model IGrouping<string, ApiDescription>
<h2 id="@Model.Key">@Model.Key</h2>
<table class="help-page-table">
<thead>
<tr><th>API</th><th>Description</th></tr>
</thead>
<tbody>
@foreach (var api in Model)
{
<tr>
<td class="api-name"><a href="@Url.Action("Api", "Help", new { apiId = api.GetFriendlyId() })">@api.HttpMethod.Method @api.RelativePath</a></td>
<td class="api-documentation">
@if (api.Documentation != null)
{
<p>@api.Documentation</p>
}
else
{
<p>No documentation available.</p>
}
</td>
</tr>
}
</tbody>
</table>
keiner von oben funktioniert. :( –