2009-08-06 30 views
0

非常に基本的な質問 - 私は答えを見つけることができませんでした。 私はasmxファイルにあるasp.net Webサービスを持っています。これは、ヘルパーライブラリから関数を呼び出す必要があります。 Visual Studioで別のasmxファイルを使用すると、すべてうまくいきました。このプロジェクトの依存関係にアセンブリを追加するだけでした。 「/」アプリケーションでモノにasp.net:アセンブリへの参照を追加する方法

サーバーエラー:私はウェブサーバ(私はこれは私が読んだの記述が言ったことだったと思う)、それは、このエラーメッセージを返すにbinサブディレクトリにアセンブリをコピーしたAltough

CS0246:型または名前空間の名前 `XXXFunctions 'が見つかりませんでした。使用しているディレクティブまたは アセンブリ参照がない はありますか?

説明:HTTP 500.エラー 処理要求。

スタックトレース:

System.Web.Compilation.CompilationException: CS0246:型または名前空間名 XXXFunctions' could not be found. Are you missing a using directive or an assembly reference? at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000] at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Collections.Generic.List 1 buildItems、System.Web.VirtualPath virtualPath、BuildKind buildKind) で[0x00000] System.Web.Compilation.BuildManager.GetCompiledType(可能System.String virtualPath)でSystem.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] [0x00000] で System.Web.Scriptで System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(System.Web.HttpContextコンテキスト、 可能System.String動詞、可能System.StringのURL、 可能System.String filePathに)[0x00000]
.Services.ScriptHandlerFactory.GetHandler (System.Web.HttpContextコンテキスト、 可能System.String requestType、 可能System.StringのURL、 pathTranslated可能System.String)[0x00000] System.Web.HttpApplication.GetHandler(System.Webので.HttpContextコンテキスト、 System.String url、Boolean ignoreContextHandler)[0x00000] at S ystem.Web.HttpApplication.GetHandler System.Web.HttpApplication + c__Iterator2.MoveNext (AT(System.Web.HttpContextコンテキスト、 可能System.StringのURL)[0x00000])[0x00000]

これは私が使用しているasmxファイル:

<%@ Assembly name="System.Web.Extensions" %> 
<%@ Assembly name="System.Runtime.Serialization" %> 
<%@ Assembly name="System.ServiceModel.Web" %> 
<%@ WebService Language="C#" Class="FCWService.FCWService" %> 

using System; 
using System.Collections; 
using System.Collections.Generic; 
using System.Web; 
using System.Web.Services; 
using System.Web.Script.Services; 
using System.Runtime.Serialization; 
using System.Runtime.Serialization.Json; 
using System.IO; 
using System.Text; 

namespace FCWService 
{ 
    [WebService (Namespace = "http://tempuri.org/NumberService")] 
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
    [ScriptService] 
    public class FCWService : System.Web.Services.WebService 
    { 
     [WebMethod] 
     [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
     public XXXFunctions.Data GetData(double length) 
     { 
      return XXXFunctions.Functions.GetData(length); 
     } 
    } 
} 

アイデアはありますか?回答


: 私は=「XXXFunctions」%>ディレクティブは、トップASMXページに欠けていた<% @アセンブリ名があったことが分かりました。

答えて

0

回答:asmxページの上に<%@ Assembly name = "XXXFunctions"%>ディレクティブがありませんでした。

1

必要なものをすべてコピーしましたか?サーバー上に存在しないXXXFunctionsという名前空間などがあるようです。

+0

binサブディレクトリにバイナリを追加した後でサーバを再起動する必要があります - この名前空間を検索するファイルは含まれていません。 – bernhardrusch

+0

ありがとうございます。<%@ Assembly name = "XXXFunctions "%>ステートメント... – bernhardrusch

関連する問題