服务'MyService'实现的合同列表中找不到合同名称'IMyService'.. ---> System.InvalidOperationException:在合同列表中找不到合同名称'IMyService'服务'我的服务'.
这真让我抓狂.我有一个WCF Web服务,可以在我的开发机器上运行,但是当我将它复制到我用于测试的虚拟机时,我得到的错误似乎表明我没有实现接口,但它没有感觉因为该服务在我的Windows XP IIS上运行.虚拟机使用Windows Server 2003 IIS.有任何想法吗?
这里需要注意的一点是,即使只是尝试在Web浏览器中作为客户端访问服务,我也会在VM上出现此错误.
注意:我使用的是principalPermissionMode ="UseWindowsGroups",但这在我的本地计算机上不是问题.我只是将自己添加到适当的Windows组.但我的VM没有运气.
配置:
<configuration>
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="false" maxSizeOfMessageToLog="2147483647" />
</diagnostics>
<services>
<service behaviorConfiguration="MyServiceBehaviors" name="MyService">
<endpoint binding="basicHttpBinding" bindingConfiguration="basicHttpBinding"
name="MyService" bindingName="basicHttpBinding" bindingNamespace="http://my.test.com"
contract="IMyService">
</endpoint>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="WindowsClientOverTcp" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehaviors"> …Run Code Online (Sandbox Code Playgroud) 我知道我可以使用如下所示的回调方法对模式验证xml,但有没有一种方法可以同步而不是事件驱动?
我想到的一种方法是设置一个类成员布尔标志IsValidated = false然后
调用xml.Validate(ValidationEventHandler).一旦完成,事件处理程序将设置IsValidated = true.同时,执行循环检查,直到标志设置为true然后继续.
这是针对.Net 3.5的.
public bool ValidateSchema(string xmlPath, string xsdPath)
{
XmlDocument xml = new XmlDocument();
xml.Load(xmlPath);
xml.Schemas.Add(null, xsdPath);
xml.Validate(ValidationEventHandler);
}
Run Code Online (Sandbox Code Playgroud)
好的,我已经完成了测试,看起来xml.validate实际上等待,直到回执完成才执行新代码.
在下面的示例中,MessageBox.Show("After Validate"); 总是在执行myValidationEventHandler之后发生.
我还通过代码来验证这一点.
所以我想这使我的问题成为一个问题.
// load etc.
...
xmlValidate(myValidationEventHandler);
MessageBox.Show("After Validate");
private void myValidationEventHandler(object sender, ValidationEventArgs e)
{
for (double i = 0; i < 100000; i++)
{
textBox1.Text = i.ToString();
Application.DoEvents();
}
// do stuff with e
}
Run Code Online (Sandbox Code Playgroud) 将Expressjs与gm(GraphicsMagick)模块一起使用。
我想使用流作为.composite()的输入。
这可能吗,或者有什么办法吗?
我可以使用路径或包含图像路径的变量进行合成,但是我想传入流(myStream)。
例:
var myStream = fs.createReadStream('topimage.png');
var resultStream = gm('/images/background.png')
.composite(myStream)
.gravity('Center')
.geometry('-1020+520')
.stream();
Run Code Online (Sandbox Code Playgroud) 这可能是非常明显的,但对于我的生活,我无法弄清楚如何做到这一点.
我有一个在InstallShield 2011中创建的基本MSI安装包.我无法弄清楚如何获得在"安装设计器"的"常规信息"页面上设置的"产品版本"字段以显示安装过程中的对话框表单.
我可以看到显示"产品名称"属性,但不显示"产品版本"
如何在安装期间向用户显示"产品版本"?
谢谢!
MoviePy TextClip 有一个颜色属性,可以设置为颜色字符串,例如 color='white'。
有没有办法将 TextClip 的文本颜色设置为特定的 RGB 值?