Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ';找不到System.web.HttpException资源';首次使用visual studio 2017 for Mac时出错_C#_Asp.net_.net_Macos_Mono - Fatal编程技术网

C# ';找不到System.web.HttpException资源';首次使用visual studio 2017 for Mac时出错

C# ';找不到System.web.HttpException资源';首次使用visual studio 2017 for Mac时出错,c#,asp.net,.net,macos,mono,C#,Asp.net,.net,Macos,Mono,我以前在windows中使用过visual studio,但这是我第一次使用IOS,我在第一次运行asp.net文件时遇到错误。我已经检查了所有可能的依赖关系,但没有任何问题。我的Globel.asax文件似乎没有问题,但我不确定我的web.confing。这是我得到的错误页面 System.Web.HttpException 找不到资源 描述:HTTP 404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请检查以下URL并确保其拼写正确 详细信息:请求的URL:/

我以前在windows中使用过visual studio,但这是我第一次使用IOS,我在第一次运行asp.net文件时遇到错误。我已经检查了所有可能的依赖关系,但没有任何问题。我的Globel.asax文件似乎没有问题,但我不确定我的web.confing。这是我得到的错误页面

System.Web.HttpException

找不到资源

描述:HTTP 404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请检查以下URL并确保其拼写正确

详细信息:请求的URL:/

异常堆栈跟踪:

在/Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/StaticFileHandler.cs:77中的System.Web.StaticFileHandler.ProcessRequest(System.Web.HttpContext上下文)[0x00094] 在/Users/builder/data/lanes/4992/mono-mac sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/System.Web/DefaultHttpHandler.cs:101中的System.Web.DefaultHttpHandler.BeginProcessRequest(System.Web.HttpContext上下文,System.asynchcallback回调,System.Object状态)[0x0007f]处 在/Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpApplication.cs:1335中的System.Web.HttpApplication+d_u225.MoveNext()[0x008d4] 在/Users/builder/data/lanes/4992/mono mac sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpApplication.cs:927中的System.Web.HttpApplication.Tick()[0x00000]

这是我的aspx文件,还没有cs文件的代码

`<%@ Page Language="C#" Inherits="fyp_codes.Login" %>
 <!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<body>
<form id="form1" runat="server">
        <div class="formclass">
            <asp:Image runat="server" imageURL="~/images/PlantManager.jfif" width="200px"/>
            <asp:Image ImageAlign="Middle" runat="server" imageURL="~/images/quote.jfif" height="128px" />
            <asp:Image runat="server" imageURL="~/images/TeamLogo.jfif" width="126px"/>


            <div style="text-align:right">
                <a href="aboutus.html" class="text-muted" target="_blank">About Plant Manager</a>
                <!–– href replace to other pages, blank: open in new tab ––>

            </div>


            <asp:label> <b> Username </b> </asp:label>
            <asp:TextBox id="TxtName" CssClass="input" placeholder="Enter Username" runat="server"/>

            <asp:label> <b> Password </b> </asp:label>
            <asp:TextBox id="TxtPsw" CssClass="input" placeholder="Enter Password" runat="server"/>

            <input type="checkbox" checked="checked" /> Remember me

            <asp:Hyperlink id="MyHyperLinkControl" NavigateUrl="http://google.com" runat="server">Forget password? </asp:Hyperlink>

            <asp:Button id="button1" runat="server" Text="Login" OnClick="button1Clicked" />

        </div>

</form>
`
用户名
密码
记得我吗
忘记密码?

Web.config:

<?xml version="1.0"?>
<!--
Web.config file for fyp_codes.

The settings that can be used in this file are documented at 
http://www.mono-project.com/Config_system.web and 
http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
-->
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5">
      <assemblies />
    </compilation>
    <httpRuntime targetFramework="4.5" />
  </system.web>
</configuration>


如果你有任何想法,请帮忙。提前谢谢你

在错误消息中,它将请求的URL声明为“/”:

详细信息:请求的URL:/

但是从你的ASPX标记来看,你已经调用了你的页面
Login.ASPX
。某些页面通常默认为index.html、index.aspx和default.aspx,web服务器配置为查找这些页面,但Login.aspx通常不是其中之一

最有可能的原因是404

(还有一个缺少的结束标记。。虽然您说您还没有对aspx.cs文件进行编码,但我假设存在一个标记-aspx页面继承自它-并且至少有一个存根用于引用的
按钮1单击的
方法。)

修复这些问题并明确请求/Login.aspx对我来说很有效:


我猜您的一幅图像没有达到应用程序的预期效果。在Mono上使用ASP.NET 4.x不是正确的方法。请升级到ASP.NET Core,因为它是唯一受支持的跨平台开发方法。