473,396 Members | 1,789 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,396 software developers and data experts.

WCF - compiler can't find TChannel

I want to provide a helper to apply a certificate to svcutil generated
class(s) that derives from ClientBase<TChannel>. But the compiler can't
find "TChannel". I have System.ServiceModel referenced, it finds ClientBase.

The stub looks like this... Any ideas appreciated. Thanks.

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

namespace whi.pw.core.webutil
{
public class CertificateResolver
{
public static void Apply(ClientBase<TChannelproxy)
{
}
}
}


Nov 10 '07 #1
3 2530
Jeff,

This is an issue with not defining the type parameter TChannel. To fix
this, you would do:

public static void Apply<TChannel>(ClientBase<TChannelproxy) where
TChannel : class

The constraint on TChannel comes from the constraint on the type
parameter TChannel in the ClientBase class.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jeff Jarrell" <jj************@yahoo.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>I want to provide a helper to apply a certificate to svcutil generated
class(s) that derives from ClientBase<TChannel>. But the compiler can't
find "TChannel". I have System.ServiceModel referenced, it finds
ClientBase.

The stub looks like this... Any ideas appreciated. Thanks.

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

namespace whi.pw.core.webutil
{
public class CertificateResolver
{
public static void Apply(ClientBase<TChannelproxy)
{
}
}
}

Nov 10 '07 #2
Ok, that did the trick but I don't quite know what it means. Might you
point me to a reference on what the "where TChannel : class". Not so much as
TChannel, just what the "where" means on the method declaration.

thanks,
jeff

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:7E**********************************@microsof t.com...
Jeff,

This is an issue with not defining the type parameter TChannel. To fix
this, you would do:

public static void Apply<TChannel>(ClientBase<TChannelproxy) where
TChannel : class

The constraint on TChannel comes from the constraint on the type
parameter TChannel in the ClientBase class.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jeff Jarrell" <jj************@yahoo.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>>I want to provide a helper to apply a certificate to svcutil generated
class(s) that derives from ClientBase<TChannel>. But the compiler can't
find "TChannel". I have System.ServiceModel referenced, it finds
ClientBase.

The stub looks like this... Any ideas appreciated. Thanks.

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

namespace whi.pw.core.webutil
{
public class CertificateResolver
{
public static void Apply(ClientBase<TChannelproxy)
{
}
}
}


Nov 11 '07 #3
Nicholas,
Ok, No need to follow up. I found the reference. The where relates to a
contraint on the Generic interface.

Thanks.

"Jeff Jarrell" <jj************@yahoo.comwrote in message
news:O2****************@TK2MSFTNGP05.phx.gbl...
Ok, that did the trick but I don't quite know what it means. Might you
point me to a reference on what the "where TChannel : class". Not so much
as TChannel, just what the "where" means on the method declaration.

thanks,
jeff

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:7E**********************************@microsof t.com...
>Jeff,

This is an issue with not defining the type parameter TChannel. To
fix this, you would do:

public static void Apply<TChannel>(ClientBase<TChannelproxy) where
TChannel : class

The constraint on TChannel comes from the constraint on the type
parameter TChannel in the ClientBase class.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jeff Jarrell" <jj************@yahoo.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>>>I want to provide a helper to apply a certificate to svcutil generated
class(s) that derives from ClientBase<TChannel>. But the compiler can't
find "TChannel". I have System.ServiceModel referenced, it finds
ClientBase.

The stub looks like this... Any ideas appreciated. Thanks.

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

namespace whi.pw.core.webutil
{
public class CertificateResolver
{
public static void Apply(ClientBase<TChannelproxy)
{
}
}
}



Nov 11 '07 #4

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

Similar topics

30
by: Neil Zanella | last post by:
Hello, Allow me to share my frustrations with GNU g++. This is the second time something similar happens to me: I can't find anything wrong with my C++ program and yet I get segfaults, and...
10
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
2
by: mudge | last post by:
Hi, I'm getting some very strange problems with some C# code. We're running an ASP.NET application on a local server in a DMZ. If I access it using the internal address, the application works...
18
by: smnoff | last post by:
Ok, I am think I am a little more knowledgeable about C and pointers, ughh. And likewise, I want to fix C.....and not so much to make a C++ or Java or C# or even D like language. So, if I...
3
by: Rene | last post by:
Hello to all! For a long time I have been "fighting" a problem compiling an OpenGL program which uses GLUT. First I have put a question in a Watcom group (I want to use this compiler) to which I...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.