473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 3640
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.