473,833 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't use System.Runtime. Remoting.Channe ls.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.Channe ls.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.Ht tp 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.Chann els' (are you
missing an assembly reference?)

Source Error:

Line 5: using System.Runtime. Remoting;
Line 6: using System.Runtime. Remoting.Channe ls;
Line 7: using System.Runtime. Remoting.Channe ls.Http;
Line 8: using SimpleRemotingA sm;
Line 9:
Source File: d:\web_services \mystuff\WS1\Ap p_Code\Service. cs Line: 7


Show Detailed Compiler Output:
c:\windows\syst em32\inetsrv>
"C:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\csc.exe" /t:library
/utf8output
/R:"C:\WINDOWS\a ssembly\GAC_MSI L\System.Config uration\2.0.0.0 __b03f5f7f11d50 a3a\System.Conf iguration.dll"
/R:"C:\WINDOWS\M icrosoft.NET\Fr amework\v2.0.50 727\Temporary ASP.NET
Files\ws1\423f2 9b4\cc2e710\ass embly\dl3\9bd5a ebf\00a8f36d_1a 37c601\SimpleRe motingAsm.DLL"
/R:"C:\WINDOWS\a ssembly\GAC_MSI L\System.Drawin g\2.0.0.0__b03f 5f7f11d50a3a\Sy stem.Drawing.dl l"
/R:"C:\WINDOWS\a ssembly\GAC_32\ System.Data\2.0 .0.0__b77a5c561 934e089\System. Data.dll"
/R:"C:\WINDOWS\M icrosoft.NET\Fr amework\v2.0.50 727\mscorlib.dl l"
/R:"C:\WINDOWS\a ssembly\GAC_MSI L\System.Web.Se rvices\2.0.0.0_ _b03f5f7f11d50a 3a\System.Web.S ervices.dll"
/R:"C:\WINDOWS\a ssembly\GAC_32\ System.Enterpri seServices\2.0. 0.0__b03f5f7f11 d50a3a\System.E nterpriseServic es.dll"
/R:"C:\WINDOWS\a ssembly\GAC_32\ System.Web\2.0. 0.0__b03f5f7f11 d50a3a\System.W eb.dll"
/R:"C:\WINDOWS\a ssembly\GAC_MSI L\System.Xml\2. 0.0.0__b77a5c56 1934e089\System .Xml.dll"
/R:"C:\WINDOWS\a ssembly\GAC_MSI L\System.Web.Mo bile\2.0.0.0__b 03f5f7f11d50a3a \System.Web.Mob ile.dll"
/R:"C:\WINDOWS\a ssembly\GAC_MSI L\System\2.0.0. 0__b77a5c561934 e089\System.dll "
/out:"C:\WINDOWS \Microsoft.NET\ Framework\v2.0. 50727\Temporary ASP.NET
Files\ws1\423f2 9b4\cc2e710\App _Code.6f30um4y. dll" /debug- /optimize+
/w:4 /nowarn:1659;169 9
"C:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\Temporary ASP.NET
Files\ws1\423f2 9b4\cc2e710\App _Code.6f30um4y. 0.cs"
"C:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\Temporary ASP.NET
Files\ws1\423f2 9b4\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\Ap p_Code\Service. cs(7,40): error CS0234:
The type or namespace name 'Http' does not exist in the namespace
'System.Runtime .Remoting.Chann els' (are you missing an assembly
reference?)

Show Complete Compilation Source:
Line 1: using System;
Line 2: using System.Web;
Line 3: using System.Web.Serv ices;
Line 4: using System.Web.Serv ices.Protocols;
Line 5: using System.Runtime. Remoting;
Line 6: using System.Runtime. Remoting.Channe ls;
Line 7: using System.Runtime. Remoting.Channe ls.Http;
Line 8: using SimpleRemotingA sm;
Line 9:
Line 10: [WebService(Name space = "http://tempuri.org/")]
Line 11: [WebServiceBindi ng(ConformsTo =
WsiProfiles.Bas icProfile1_1)]
Line 12: public class Service : System.Web.Serv ices.WebService
Line 13: {
Line 14: public Service () {
Line 15:
Line 16: //Uncomment the following line if using designed
components
Line 17: //InitializeCompo nent();
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 .RegisterChanne l(c);
Line 32:
Line 33: // Get a proxy to remote object.
Line 34: object remoteObj = Activator.GetOb ject(
Line 35: typeof(SimpleRe motingAsm.Remot eMessageObject) ,
Line 36: "http://localhost:32469/RemoteMsgObj.so ap");
Line 37:
Line 38: RemoteMessageOb ject simple =
(RemoteMessageO bject)remoteObj ;
Line 39: simple.DisplayM essage("Hello from the client!");
Line 40: return simple.ReturnMe ssage();
Line 41: }
Line 42: }
Line 43:

Feb 21 '06 #1
2 3705
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="Syste m.Runtime.Remot ing, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= B77A5C561934E08 9"/>
</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
2265
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 like machineName=@IPAddress or some such thing...
0
1553
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. ==== Primary Call Stack ==== at ?Setup@EdgeTopImageProcessor@Edge@InspectionAlgorithm@August@@$$FQAEXHHHHW4eBayerFormatType@BayerImage@234@ABUEdgeTopParam@1234@PAVErrorTraveler@Unmanaged@Infrastructure@4@@Z(EdgeTopImageProcessor* , Int32 , Int32...
2
4695
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 'System.Runtime.Remoting.Channels' (are you missing an assembly reference?) I have the following using statements at the begining of the file.
2
1580
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 thoughts, helps, guidance, hints, or pointers are greatly appreciated!! Regards,
2
5519
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
3348
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 .NET Windows Service on the same machine. ..NET 1.1 SP1 Any suggestions?
4
3418
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 HttpChannel(4000);
0
755
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. 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...
2
3731
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) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
2
11021
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 on a W23 server SP2, I get the following error: System.Runtime.Remoting.RemotingException: Remoting configuration failed with the exception 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation....
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10782
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10543
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4422
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.