Endpoint 与 Windows 沉浸式项目版本 1 不兼容
由于某种原因,我使用“添加服务引用”向导为 wcf 服务生成代码时出错。
Custom tool warning: No endpoints compatible with version 1 of windows immersive project were found. C:\work\test_projects\CirMetro\Service References\SvcProxy\Reference.svcmap 1 1 CirMetro
你们知道如何解决吗?
我的示例 WCF 服务非常简单。这是源代码:
static void Main()
{
UiWcfSession.OnInitialize += ClientInitialize;
var baseAddresses = new Uri("net.tcp://localhost:9000/");
var host = new ServiceHost(typeof(UiWcfSession), baseAddresses);
var reliableSession = new ReliableSessionBindingElement { Ordered = true, InactivityTimeout = new TimeSpan(24, 20, 31, 23) };
var binding =
new CustomBinding(reliableSession, new TcpTransportBindingElement()) { ReceiveTimeout = TimeSpan.MaxValue };
host.AddServiceEndpoint(typeof(IClientFulfillmentPipeService), binding, "svc");
var metadataBehavior = new ServiceMetadataBehavior();
host.Description.Behaviors.Add(metadataBehavior);
var mexBinding = MetadataExchangeBindings.CreateMexTcpBinding();
host.AddServiceEndpoint(typeof(IMetadataExchange), mexBinding, "mex");
host.Open();
Thread.CurrentThread.Join();
}
private static void ClientInitialize(int uiprocessid, string key)
{
Debug.WriteLine("ClientInitialize");
}
For some reason I have error generating code for a wcf service using "Add service reference" wizard.
Custom tool warning: No endpoints compatible with version 1 of windows immersive project were found. C:\work\test_projects\CirMetro\Service References\SvcProxy\Reference.svcmap 1 1 CirMetro
Do you guys know how to fix it ?
My sample WCF service is braindead simple. Here is source code:
static void Main()
{
UiWcfSession.OnInitialize += ClientInitialize;
var baseAddresses = new Uri("net.tcp://localhost:9000/");
var host = new ServiceHost(typeof(UiWcfSession), baseAddresses);
var reliableSession = new ReliableSessionBindingElement { Ordered = true, InactivityTimeout = new TimeSpan(24, 20, 31, 23) };
var binding =
new CustomBinding(reliableSession, new TcpTransportBindingElement()) { ReceiveTimeout = TimeSpan.MaxValue };
host.AddServiceEndpoint(typeof(IClientFulfillmentPipeService), binding, "svc");
var metadataBehavior = new ServiceMetadataBehavior();
host.Description.Behaviors.Add(metadataBehavior);
var mexBinding = MetadataExchangeBindings.CreateMexTcpBinding();
host.AddServiceEndpoint(typeof(IMetadataExchange), mexBinding, "mex");
host.Open();
Thread.CurrentThread.Join();
}
private static void ClientInitialize(int uiprocessid, string key)
{
Debug.WriteLine("ClientInitialize");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。
不幸的是,我们必须反编译 Visual Studio 的源代码才能找出 Metro 中有效的内容,而不是参考不存在的文档:-)
简而言之,我无法使用 ReliableSession。
如果您想了解更多详细信息
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.ServiceReference.Platforms.dll
包含检查支持的功能。I figured it out.
It's unfortunate that we have to decompile sources of Visual Studio to find out what works in Metro instead of referring to non-existent documentation :-)
In short I can't use ReliableSession.
If you want more details
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.ServiceReference.Platforms.dll
contains function which check what is supported.