WCF i zewnętrzna biblioteka dll

0

Witam,

Napisałem w C# bibliotekę którą bez problemu używam przy pisaniu service-ów jak i winformów. Teraz chciałem z niej skorzystać podczas pisania WCF Service Library.

mydll.dll:

namespace mynamespace
{
public class myclass
    {
        private string _ble;
        public string Ble { set; get; }
    }
}

Dodaje referencję do projektu (domyślny z VS2010) i jest git dopóki nie chcę tego uruchomić.

[DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }

        [DataMember]
        public myclass WCmyclass { get; set; }

    }

Dostaję:

Error: Cannot obtain Metadata from http://localhost:8732/Design_Time_Addresses/WcfTest/Service1/mex If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:8732/Design_Time_Addresses/WcfTest/Service1/mex Metadata contains a reference that cannot be resolved: 'http://localhost:8732/Design_Time_Addresses/WcfTest/Service1/mex'. <?xml version="1.0" encoding="utf-16"?><Fault xmlns="http://www.w3.org/2003/05/soap-envelope"><code><Value>Receiver</Value><Subcode><Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</Value></Subcode></Code><Reason><Text xml:lang="pl-PL">The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug&gt; configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</Text></Reason></Fault>HTTP GET Error URI: http://localhost:8732/Design_Time_Addresses/WcfTest/Service1/mex There was an error downloading 'http://localhost:8732/Design_Time_Addresses/WcfTest/Service1/mex'. The request failed with HTTP status 400: Bad Request.

Co robie nie tak?

0

Pokaż web.config :)

0

App.config

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true"/>
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="WcfTest.Service1">
        <endpoint address="" binding="wsHttpBinding" contract="WcfTest.IService1">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfTest/Service1/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
 

1 użytkowników online, w tym zalogowanych: 0, gości: 1