C
cj2
I wrote a web service in VB2008. I then wrote a windows app that calls
it. I added the web service as a service reference. I ran the program
in debug mode and things worked fine. I then changed to release mode
created the exe and ran that and it gave the following error:
System.InvalidOperationException was unhandled
Message="Could not find default endpoint element that references
contract 'MyValWebService.MyValidationSoap' in the ServiceModel client
configuration section. This might be because no configuration file was
found for your application, or because no endpoint element matching this
contract could be found in the client element."
Source="System.ServiceModel"
StackTrace:
at
System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint
serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String
configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String
configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String
endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
at
System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1
endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor()
at RadIpVal.Module1.SessionClass.ThreadMain() in C:\Documents
and Settings\cj.My\My Documents\Visual Studio
2008\Projects\RadIpVal\RadIpVal\Module1.vb:line 17
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Just as a test. I deleted the service reference and added it as a web
reference and now it will work in release mode.
Why?
it. I added the web service as a service reference. I ran the program
in debug mode and things worked fine. I then changed to release mode
created the exe and ran that and it gave the following error:
System.InvalidOperationException was unhandled
Message="Could not find default endpoint element that references
contract 'MyValWebService.MyValidationSoap' in the ServiceModel client
configuration section. This might be because no configuration file was
found for your application, or because no endpoint element matching this
contract could be found in the client element."
Source="System.ServiceModel"
StackTrace:
at
System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint
serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String
configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String
configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String
endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
at
System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1
endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor()
at RadIpVal.Module1.SessionClass.ThreadMain() in C:\Documents
and Settings\cj.My\My Documents\Visual Studio
2008\Projects\RadIpVal\RadIpVal\Module1.vb:line 17
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Just as a test. I deleted the service reference and added it as a web
reference and now it will work in release mode.
Why?