0

MonoとXSPWebサーバーを使用して、最初のASP.NETWebページをWindowsで動作させようとしています。

私はこのチャップスのに従っています。彼の例の最初の部分は、最新バージョンのモノラルで非常にうまく機能します。ただし、Webパーツは次のエラーで倒れているようです

'{パス名}\Index.aspx.cs'は有効な仮想パスではありません。

完全なスタックトレースは次のとおりです。

System.Web.HttpException: 'C:\Projects\Mono\ASPExample\simpleapp\index.aspx.cs' is not a valid virtual path.  
   at System.Web.HttpRequest.MapPath (System.String virtualPath, System.String baseVirtualDir, Boolean allowCrossAppMapping) [0x00000]   
   at System.Web.HttpRequest.MapPath (System.String virtualPath) [0x00000]   
   at System.Web.Compilation.BuildManager.AddToCache (System.String virtualPath, System.Web.Compilation.BuildProvider bp) [0x00000]   
   at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000]   
   at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000]   
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.String virtualPath, System.Type requiredBaseType) [0x00000]   
   at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000]
   at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000]
   at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000]
   at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000]
   at System.Web.HttpApplication+<Pipeline>c__Iterator5.MoveNext () [0x00000] 

このエラーの意味を誰かが知っているのだろうかと思っていました。Windows版を試してみたモノのエキスパートを探していると思います。

4

4 に答える 4

1

xsp の起動に使用しているコマンド ラインを貼り付けることができますか? 単一の webapp を実行しているだけの場合、このようなものは実際には必要なく、問題の原因になる可能性があります。

xsp --applications /SimpleWebApp:C:\Projects\Mono\ASPExample\

cd で ASPExample ディレクトリに移動し、パラメータを指定せずに xsp を実行します。

于 2008-11-15T03:21:25.610 に答える
0

私が使用していたコマンドはこれでした:

@echo off
call C:\PROGRA~1\MONO-2~1.1\bin\setmonopath.bat
xsp --root . --port 8088 --applications /:.

パラメータなしでXSPを実行しようとすると、次の出力が得られます。

xsp2アドレスでリッスン:0.0.0.0ルートディレクトリ:C:\ Projects \ Mono \ ASPExampleポートでリッスン:8080(非セキュア)Returnキーを押してサーバーを停止します。

でプロジェクトを閲覧しようとすると

http:// localhost:8080

csファイルが有効な仮想パスではないことをうめき声を上げる前と同じ出力が得られます。

ASPXページのsrc属性が問題だと思います。おそらく、Monoの新しいバージョンで更新されています。それを調べます。

ところであなたの返事をありがとう。

デイブ

于 2008-11-17T10:56:08.033 に答える
0

「コードビハインド」を機能させる方法がわかりませんが、満足のいく回避策を見つけました。他の人の利益のためにここに投稿すると思いました。基本的に、コード ビハインドをメイン ページに移動すると、

XSD コマンドとパラメーターなし。

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Code behind Arrrrrrrrrrgh</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script runat="server">
    private void Page_Load(Object sender, EventArgs e)
    {
       DisplayServerDetails();
       DisplayRequestDetails();

    }

    private void DisplayServerDetails()
      {
        serverName.Text = Environment.MachineName;
        operatingSystem.Text = Environment.OSVersion.Platform.ToString();
        operatingSystemVersion.Text = Environment.OSVersion.Version.ToString();
      }

      private void DisplayRequestDetails()
      {
         requestedPage.Text = Request.Url.AbsolutePath;
         requestIP.Text = Request.UserHostAddress;
         requestUA.Text = Request.UserAgent;
      }

    </script>

  </head>

  <body>
    <form method="post" runat="server">
         <table width="450px" border="1px">
            <tr>
               <td colspan="2"><strong>Server Details</strong></td>
            </tr>
            <tr>
               <td>Server Name:</td>
               <td>
                  <asp:Label id="serverName" runat="server"></asp:Label></td>
            </tr>
            <tr>
               <td>Operating System:</td>
               <td>
                  <asp:Label id="operatingSystem" runat="server"></asp:Label>
               </td>
            </tr>
            <tr>
               <td>Operating System Version:</td>
               <td>
                  <asp:Label id="operatingSystemVersion" runat="server">
                  </asp:Label>
               </td>
            </tr>
         </table>
         <br>
         <table width="450px" border="1px">
            <tr>
               <td colspan="2"><strong>Request Details</strong></td>
            </tr>
            <tr>
               <td>Page Requested:</td>
               <td>
                  <asp:Label id="requestedPage" runat="server"></asp:Label>
               </td>
            </tr>
            <tr>
               <td>Request From:</td>
               <td>
                  <asp:Label id="requestIP" runat="server"></asp:Label>
               </td>
            </tr>
            <tr>
               <td>User Agent:</td>
               <td>
                  <asp:Label id="requestUA" runat="server"></asp:Label>
               </td>
            </tr>
         </table>
      </form>
  </body>
于 2008-11-17T12:27:19.453 に答える
0

xsp ではなく xsp2 を実行してみましたか?

于 2008-11-18T19:25:00.297 に答える