问题:

我试图通过Web部署将我的计算机上的网站发布到IIS Web服务器。

我有3台服务器。 所有服务器都安装了相同的东西(Webdeploy等)并启动了服务(Web部署代理服务和Web管理服务)。

在第一台服务器上,我没有连接问题。 但是当我在Visual Studio中“验证连接”到IIS时,其他两个服务器给我一些错误。 当我查看IIS服务器上的日志时,我的访问监听了html代码200(ok)。

在远程计算机上处​​理请求时出错。 文件名:MACHINE / WEBROOT

错误:无法读取配置节’system.webServer / management / delegation’,因为它缺少架构

我真的不知道什么可以解决这个问题,希望你能帮助我。

I am trying to publish a website from my computer to an IIS web server via web deploy.I have 3 servers.All servers have installed the same things (Webdeploy etc.) and the services are started (Web Deployment Agent Service and Web Management Service).On the first server I have no problems on connecting.But the other two servers give me some error when I “Validate Connection” in Visual Studio to the IIS.When I look at the logs on the IIS server, there are my accesses listet with html code 200 (ok).An error ocurred when the request was processed on the remote computer.Filename: MACHINE/WEBROOTError: The configuration section ‘system.webServer/management/delegation’ cannot be read because it is missing schemaI really have no idea what could solve this problem and hope you are able to help me.

问题:

我在IIS中有一个网站,我无法打开任何设置,如身份验证,处理程序映射,授权规则等。它只显示错误消息“执行此操作时出错”,没有更多详细信息和指向Web的.config。

浏览网站会导致500.19错误。

我尝试将iis_iusrs添加到网站文件夹和web.config,更改应用程序池标识,以便访问web.config /网站文件夹安全设置,验证目标框架,iisreset / app pool回收无效。

I have a website in IIS for which I cannot open any of the settings like Authentication, Handler Mappings, Authorization Rules etc. It just shows the error message “There was an error while performing this operation”, with no more details and points to web.config.Browsing the website results in a 500.19 error.I tried adding iis_iusrs to the website folder and web.config, changing the app pool identity giving access to same on web.config/website folder security settings, verified target framework, iisreset/app pool recycles to no avail.

问题:

我正在使用Web API创建一个Web服务。 我实现了一个简单的类

public class ActivityResult
{
    public String code;
    public int indexValue;
    public int primaryCodeReference;
}

然后我在我的控制器内实现了

[HttpPost]
public HttpResponseMessage Post(ActivityResult ar)
{
    return new HttpResponseMessage(HttpStatusCode.OK);
}

但是当我调用API传递POST文件时json:

{"code":"XXX-542","indexValue":"3","primaryCodeReference":"7"}

我收到以下错误消息:

{
    "Message": "The request entity's media type 'text/plain' is not supported for this resource.",
    "ExceptionMessage": "No MediaTypeFormatter is available to read an object of type 'ActivityResult' from content with media type 'text/plain'.",
    "ExceptionType": "System.Net.Http.UnsupportedMediaTypeException",
    "StackTrace": "   in System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)\r\n   in System.Net.Http.HttpContentExtensions.ReadAsAsync(HttpContent content, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)\r\n   in System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)"
}

我究竟做错了什么?

I’m creating a web service using Web API.I implemented a simple classAnd then I have implemented inside my controllerBut when I call the API passing in POST the file json:I obtain the following error message:What am I doing wrong?

问题:

我有一个小型网络应用程序。 直到我在应用程序中添加了两个genericHandler之前,它都运行良好。

我对http处理程序进行了以下更改

 <system.web>
    <authentication mode="Forms" >
        <forms protection="All" timeout="720" defaultUrl="Default.aspx" loginUrl="Login.aspx" >
        </forms>
    </authentication>
    <authorization>
        <deny users="?"/>
    </authorization>
    <compilation debug="true" targetFramework="4.0" />

    <httpHandlers>
        <!--Code Log Handler-->
        <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory" />
        <add verb="*" type="InfoDomeNewUI.Handler.SendOWA" path="SendOWA.ashx" />
        <add verb="*" type="InfoDomeNewUI.Handler.SendSOS" path="SendSOS.ashx" />
    </httpHandlers>
    <customErrors mode="Off">
        <error statusCode="404" redirect="Templates/PageNotFound.html" />
    </customErrors>
</system.web>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
        <!--Code Log Handler-->
        <add name="LogHandler1" path="SendOWA.ashx" verb="*" type="InfoDomeNewUI.Handler.SendOWA"/>
        <!-- SMS SENDER-->
        <add name="SendSOS" path="SendSOS.ashx" verb="*" type="InfoDomeNewUI.Handler.SendSOS"/>
    </handlers>
</system.webServer>

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

我正在使用asp.net4.0和C#。 我没有使用MVC
在本地主机上,它运行良好。
但是当我托管发布的代码时,它给了我上面的错误。

堆栈跟踪:-

[FileNotFoundException:无法加载文件或程序集’Microsoft.Web.Infrastructure,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35’或其依赖项之一。 系统找不到指定的文件。] System.Web.Http.WebHost.SuppressFormsAuthRedirectModule.Register()+0

[InvalidOperationException:应用程序前启动初始化方法System.Web.Http.WebHost.PreApplicationStartCode类型上引发了带有以下错误消息的异常:无法加载文件或程序集’Microsoft.Web.Infrastructure,Version = 1.0.0.0,文化=中性,PublicKeyToken = 31bf3856ad364e35’或其依赖项之一。 系统无法找到指定的文件。 ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters HostingParameters,PolicyLevel policyLeve

[HttpException(0x80004005):在类型System.Web.Http.WebHost.PreApplicationStartCode上启动的应用程序前初始化方法引发了异常,并出现以下错误消息:无法加载文件或程序集’Microsoft.Web.Infrastructure,Version = 1.0 .0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35’或其依赖项之一。 系统无法找到指定的文件。 +4866485

I have a small web application.Which was working fine until I added two genericHandler in my application.I have made the following changes for the http handlerI am using asp.net4.0 and C#.I am not using MVCOn local host it is working fine.But when I am hosting the published code it is giving me the above error.Stack Trace:-[FileNotFoundException: Could not load file or assembly ‘Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.The system cannot find the file specified.] System.Web.Http.WebHost.SuppressFormsAuthRedirectModule.Register() +0[InvalidOperationException: The pre-application start initialization method Start on type System.Web.Http.WebHost.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly ‘Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.The system cannot find the file specified..] System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +11708830 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +465 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLeve[HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.Http.WebHost.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly ‘Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.The system cannot find the file specified..] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11697760 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4866485

问题:

为什么我收到错误:

模板只能用于字段访问,属性访问,单维数组索引或单参数自定义索引器表达式

在这段代码:

@model IEnumerable<ArtSchoolProject.Models.Trainer>

@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_PageLayout.cshtml";
}

<h2>Index</h2>

<p>
@Html.ActionLink("Create New", "Create")
</p>
<ul class="trainers">


@foreach (var item in Model) {
<li>
  <div>
      <div class="left">
          <a href="@Url.Action("Details", "Details", new { id = item.ID })">
              <img src="~/Images/Trainer/@item.Picture" />
          </a>
      </div>
      <div class="right">
          @Html.ActionLink(item.Name,"Details",new {id=item.ID})
          <br />
          @Html.DisplayFor(modelItem=>@string. item.Description.ToString().Substring(0,100))
      </div>
  </div>
  </li>
  }

  </ul>

在线:

@Html.DisplayFor(modelItem=>item.Description.ToString().Substring(0,100))

更新:

问题解决了。 我添加到我的代码中:

  @{
string parameterValue = item.Description.ToString().Substring(0, 100); 
          }
          @Html.DisplayFor(modelItem=>parameterValue)

我的新代码:

@foreach (var item in Model) {
<li>
  <div>
      <div class="left">
          <a href="@Url.Action("Details", "Details", new { id = item.ID })">
              <img src="~/Images/Trainer/@item.Picture" />
          </a>
      </div>
      <div class="right">
          @Html.ActionLink(item.Name,"Details",new {id=item.ID})
          <br />
          @{
string parameterValue = item.Description.ToString().Substring(0, 100); 
          }
          @Html.DisplayFor(modelItem=>parameterValue)
      </div>
  </div>
 </li>
}

这只是一种可能性。 只是出于好奇,还有另一种解决错误的方法吗?

Why am I receiving the error:Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressionsat this code:at line:Update:Problem solved.I added to my code :My new code:This is only one possibility.Just for curiosity is there another solution for solving the error?