472,783 Members | 1,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 software developers and data experts.

Can't use System.Runtime.Remoting.Channels.Http in WebService?

I'm trying to use a Web Service to be a Remoting client of an existing
..NET 2.0 server. But I get the following error when I try to use
System.Runtime.Remoting.Channels.Http in my WebService. The same code
works fine in a standalone app. I have inspected
System.Runtime.Remoting.dll with ildasm, and I can see the
....Channels.Http namespace there. I verified that the virtual
directory is configured to use v2.0.50727 (the error message confirms
this). Am I missing something?

Thanks,
Kirk

Server Error in '/WS1' 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 'Http' does
not exist in the namespace 'System.Runtime.Remoting.Channels' (are you
missing an assembly reference?)

Source Error:

Line 5: using System.Runtime.Remoting;
Line 6: using System.Runtime.Remoting.Channels;
Line 7: using System.Runtime.Remoting.Channels.Http;
Line 8: using SimpleRemotingAsm;
Line 9:
Source File: d:\web_services\mystuff\WS1\App_Code\Service.cs Line: 7


Show Detailed Compiler Output:
c:\windows\system32\inetsrv>
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc .exe" /t:library
/utf8output
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporary ASP.NET
Files\ws1\423f29b4\cc2e710\assembly\dl3\9bd5aebf\0 0a8f36d_1a37c601\SimpleRemotingAsm.DLL"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Service s\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dl l"
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__ b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\ 2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 \Temporary ASP.NET
Files\ws1\423f29b4\cc2e710\App_Code.6f30um4y.dll" /debug- /optimize+
/w:4 /nowarn:1659;1699
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws1\423f29b4\cc2e710\App_Code.6f30um4y.0.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\ws1\423f29b4\cc2e710\App_Code.6f30um4y.1.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

d:\web_services\mystuff\WS1\App_Code\Service.cs(7, 40): error CS0234:
The type or namespace name 'Http' does not exist in the namespace
'System.Runtime.Remoting.Channels' (are you missing an assembly
reference?)

Show Complete Compilation Source:
Line 1: using System;
Line 2: using System.Web;
Line 3: using System.Web.Services;
Line 4: using System.Web.Services.Protocols;
Line 5: using System.Runtime.Remoting;
Line 6: using System.Runtime.Remoting.Channels;
Line 7: using System.Runtime.Remoting.Channels.Http;
Line 8: using SimpleRemotingAsm;
Line 9:
Line 10: [WebService(Namespace = "http://tempuri.org/")]
Line 11: [WebServiceBinding(ConformsTo =
WsiProfiles.BasicProfile1_1)]
Line 12: public class Service : System.Web.Services.WebService
Line 13: {
Line 14: public Service () {
Line 15:
Line 16: //Uncomment the following line if using designed
components
Line 17: //InitializeComponent();
Line 18: }
Line 19:
Line 20: [WebMethod]
Line 21: public string HelloWorld()
Line 22: {
Line 23: return "Hello World";
Line 24: }
Line 25:
Line 26: [WebMethod]
Line 27: public void Main(string[] args)
Line 28: {
Line 29: // Create a new HttpChannel
Line 30: HttpChannel c = new HttpChannel();
Line 31: ChannelServices.RegisterChannel(c);
Line 32:
Line 33: // Get a proxy to remote object.
Line 34: object remoteObj = Activator.GetObject(
Line 35: typeof(SimpleRemotingAsm.RemoteMessageObject),
Line 36: "http://localhost:32469/RemoteMsgObj.soap");
Line 37:
Line 38: RemoteMessageObject simple =
(RemoteMessageObject)remoteObj;
Line 39: simple.DisplayMessage("Hello from the client!");
Line 40: return simple.ReturnMessage();
Line 41: }
Line 42: }
Line 43:

Feb 21 '06 #1
2 3579
I noticed that on my web server, all my file associations for aspx,
asax, ascx, etc. all point to v1.1 of the framework. I installed the
2.0 framework on that machine, but it apparently didn't update all the
file associations. Is there something I can run to update them? Is it
possible this is the source of my problem?

Thanks,
Kirk

Feb 21 '06 #2
Well, I figured out my original problem. I needed to add a reference
to the assembly System.Runtime.Remoting in my Web.Config as follows:

<assemblies>
<add assembly="System.Runtime.Remoting, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>

Visual Studio 2005 can do this for you if you right click in the
Solution Explorer and select Add Reference...

Feb 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jabailo | last post by:
I have the config file below. Is there anyway for the value of MachineName to be populated, automatically, with the IP address that the application is running on? So, I would say something...
0
by: Ken Durden | last post by:
I'm getting the following exception coming out of a block of unmanaged C++ code. Thread executed for 1.03 sec and died with the following exception: External component has thrown an exception. ...
2
by: Jeff Green | last post by:
Hello all, Can anyone explain why I keep getting the following error? C:\Project\CalcServer\CalcServer.cs(4): The type or namespace name 'Http' does not exist in the class or namespace...
2
by: Knut Vonheim | last post by:
For some reason I cannot access this in CSharp - neither with using or directly in the code? System.Runtime.Remoting.Channels on the other hand is fine, but no Http.anything works. Any...
2
by: web1110 | last post by:
Hi y'all, I'm playing with C# again, trying to implement a remoted calculator exercise. If I include: using System.Runtime.Remoting.Channels.Http; I get the error:
1
by: Samuel R. Neff | last post by:
We just started getting NullReferenceException in one of our applications on our demo server. This is occuring in a .NET Windows Service that is using binary remoting over TCP to talk to another...
4
by: marcelino | last post by:
Hi, I have c# express beta I try to write the following using clause: System.Runtime.Remoting.Channels.Http; because I want to create a http channel. HttpChannel aJobChannel = new...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
2
by: SenthilVel | last post by:
Hi All i am getting an error in remoting proxies like the below : Exception rethrown at : at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)...
2
by: =?Utf-8?B?c2FtMDFt?= | last post by:
I have a remoting application that was developed on a Windows XP SP2 machine with VS2005 SP1. I finally got everything deployed using Wix 3.0, and it works great. Problem is, when I install the msi...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.