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

the contract name could not be (WCF silverlight)

Hi All,

I am new to silverlight and i am following a tutorial.
In order to connect to database in silverlight application i need to add a referance to a service. which gives me an error that the contract is not found.

I had installed the iis after .net framework 3.5 but i have followed and done all the instructions given at microsoft's website.

please help me.


below is the error stack--
Expand|Select|Wrap|Line Numbers
  1. There was an error downloading 'http://localhost:50926/Service1.svc'.
  2. The request failed with the error message:
  3. --
  4. <html>
  5.     <head>
  6.         <title>The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'.</title>
  7.         <style>
  8.          body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
  9.          p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
  10.          b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
  11.          H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
  12.          H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
  13.          pre {font-family:"Lucida Console";font-size: .9em}
  14.          .marker {font-weight: bold; color: black;text-decoration: none;}
  15.          .version {color: gray;}
  16.          .error {margin-bottom: 10px;}
  17.          .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
  18.         </style>
  19.     </head>
  20.  
  21.     <body bgcolor="white">
  22.  
  23.             <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
  24.  
  25.             <h2> <i>The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'.</i> </h2></span>
  26.  
  27.             <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
  28.  
  29.             <b> Description: </b>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.
  30.  
  31.             <br><br>
  32.  
  33.             <b> Exception Details: </b>System.InvalidOperationException: The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'.<br><br>
  34.  
  35.             <b>Source Error:</b> <br><br>
  36.  
  37.             <table width=100% bgcolor="#ffffcc">
  38.                <tr>
  39.                   <td>
  40.                       <code>
  41.  
  42. 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.</code>
  43.  
  44.                   </td>
  45.                </tr>
  46.             </table>
  47.  
  48.             <br>
  49.  
  50.             <b>Stack Trace:</b> <br><br>
  51.  
  52.             <table width=100% bgcolor="#ffffcc">
  53.                <tr>
  54.                   <td>
  55.                       <code><pre>
  56.  
  57. [InvalidOperationException: The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'.]
  58.    System.ServiceModel.Description.ConfigLoader.LookupContract(String contractName, String serviceName) +11606655
  59.    System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +11605707
  60.    System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +55
  61.    System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName) +35
  62.    System.ServiceModel.ServiceHostBase.ApplyConfiguration() +69
  63.    System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +190
  64.    System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +32
  65.    System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +139
  66.    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28
  67.    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331
  68.    System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11656060
  69.    System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
  70.    System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
  71.  
  72. [ServiceActivationException: The service '/Service1.svc' cannot be activated due to an exception during compilation.  The exception message is: The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'..]
  73.    System.ServiceModel.AsyncResult.End(IAsyncResult result) +11527194
  74.    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
  75.    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
  76.    System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +23
  77.    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
  78.    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
  79. </pre></code>
  80.  
  81.                   </td>
  82.                </tr>
  83.             </table>
  84.  
  85.             <br>
  86.  
  87.             <hr width=100% size=1 color=silver>
  88.  
  89.             <b>Version Information:</b>*Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
  90.  
  91.             </font>
  92.  
  93.     </body>
  94. </html>
  95. <!-- 
  96. [InvalidOperationException]: The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'.
  97.    at System.ServiceModel.Description.ConfigLoader.LookupContract(String contractName, String serviceName)
  98.    at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress)
  99.    at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
  100.    at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName)
  101.    at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
  102.    at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
  103.    at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
  104.    at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
  105.    at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
  106.    at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
  107.    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
  108.    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
  109.    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
  110. [ServiceActivationException]: The service '/Service1.svc' cannot be activated due to an exception during compilation.  The exception message is: The contract name 'SQLData.IService1' could not be found in the list of contracts implemented by the service 'Service1'..
  111.    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
  112.    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
  113.    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext)
  114.    at System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context)
  115.    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  116.    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
  117. -->
  118. --.
  119. Metadata contains a reference that cannot be resolved: 'http://localhost:50926/Service1.svc'.
  120. The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
  121. If the service is defined in the current solution, try building the solution and adding the service reference again.
Mar 24 '09 #1
1 8237
Plater
7,872 Expert 4TB
Somewhere you are trying to use 'SQLData.IService1' and it doesn't exist. Either create it, or rename it to a service you do have?
According to the error message, its trying to run as .NET2.0, you might need to change it to use 3.5?
Mar 25 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully to that service and retrieves data. I then ported...
2
by: Ronald S. Cook | last post by:
Hi, Some users on our domain can run our WCF application no problem. Some get an unhandled exception error re: SOAP security negotiation. I'm wanting the service to not be secure.. I just want...
1
by: Ronald S. Cook | last post by:
Performance in our WCF application is very poor now that we've added a number of records to tables (not an unrealistic number, though). After doing that, we did get "max message size" errors to I...
1
by: Ronald S. Cook | last post by:
Performance in our WCF application is very poor now that we've added a number of records to tables (not an unrealistic number, though). After doing that, we did get "max message size" errors to I...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi misters, i have an app.config of my App that uses WCF. I need change the configuration servicemodel, and I want update somes values.
7
by: GaryDean | last post by:
(this was also posted on the MSDN WCF forum but the answers over there are not so good) I have a WCF Library hosted by IIS 6 and it all works fine. However I need to step through the code in the...
2
by: Steven Cheng | last post by:
Hi Gary, As for the setting you mentioned, it is used to custimze the received data size limitation of WCF binding(such as NetTcpBinding or HttpBinding). After you have definite a customized...
0
by: Jesper Lund Stocholm | last post by:
I have the following requirements: a. Have a WCF-service hosted on IIS (6.0) b. Pass user's AD-credentials to the WCF-service c. NOT use SSL/HTTPS So in IIS I have disabled anonymous access...
3
by: cmrhema | last post by:
Hi, Kindly excuse if I am posting in the wrong place. I am using Visual Studio 2008, .net framework 3.5, asp.net , c# and sql server 2005. I am supposed to pass stored procedures from client...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.