编程部门要求我测试部署他们的一个应用程序。据我所知,关于该应用程序,它是一个用于 wpf 应用程序的 webservice wcf 代码 c#。他们确实告诉我他们确实尝试将证书直接放在 web 服务中(以避免注册 ssl 证书并将它们保存在每个客户端应用程序中的麻烦)。
到目前为止我没有问题。但是有一个小技巧。
我一直在尝试在 localhost 中部署这个东西(以确保完成它的过程),并且一切都很好(确实获得了带有此消息的成功 svc 加载页面):
blabla 成功
svcutil.exe http://###deployment.eslan2.local/Service###.svc?wsdl
C#
class Test
{
static void Main()
{
//how to blabla
client.Close();
}
}
但是当我尝试在我的 IIS 网络服务器(带有 IIS7.5 的 ws2K8R2)上部署网络服务时,我得到了这个讨厌的但不是很有帮助的错误消息:
Server Error in '/' Application.
The specified network password is not correct.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: The specified network password is not correct.
来源错误:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: The specified network password is not correct.]
System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr) +41
System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) +0
System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags) +335
System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData) +101
Effect.ServiceModel.ServiceBehaviorHandlerAttribute.ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) +623
[ServiceModelException: An error occurs during service management.]
Effect.ServiceModel.ServiceBehaviorHandlerAttribute.ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) +1782
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +3565
System.ServiceModel.ServiceHostBase.InitializeRuntime() +82
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +64
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +287
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1132
我花了 3 天时间在网上四处寻找答案,但到目前为止没有任何有价值的东西。
我一直认为它不是来自我的服务器,而是错误来自的代码。