Domanda

I am receiving the following error when I enter in the url of my service application.

"Could not load file or assembly '$SharePoint.Project.AssemblyFullName$' or one of its dependencies. The system cannot find the file specified."

However, the .svc file is located in the Hive 14/WebServices folder, so I don't know why it is saying it can't find the file. My service application also fails, obviously, stating that "There are no addresses available for this application."

Sorry I can't provide much more information. Can anyone shine any light on to this one?

Here is my web.config file and .svc file just in case.

<%@ServiceHost Language="C#"
Service="AF.TipAndLeadAPI.TipAndLeadAPIServiceApplication, $SharePoint.Project.AssemblyFullName$" 
Factory="AF.TipAndLeadAPI.TipAndLeadAPIServiceHostFactory, $SharePoint.Project.AssemblyFullName$" %>


<configuration>
  <system.web>
    <compilation debug="true" defaultLanguage="C#" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="TLAPITypeBehaviors" >
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="AF.TipAndLeadAPI.TipAndLeadAPIServiceApplication" behaviorConfiguration="TLAPITypeBehaviors">
        <endpoint binding="customBinding" bindingConfiguration="TLAPIServiceHttpBinding"
                  contract="AF.TipAndLeadAPI.ITipAndLeadAPIContract"
                  address="" />
        <endpoint binding="customBinding" bindingConfiguration="TLAPIServiceHttpsBinding"
                  contract="AF.TipAndLeadAPI.ITipAndLeadAPIContract"
                  address="secure" />
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    <bindings>
      <customBinding>
        <binding name="TLAPIServiceHttpBinding">
          <security authenticationMode="IssuedTokenOverTransport" allowInsecureTransport="true" />
          <binaryMessageEncoding>
            <readerQuotas maxStringContentLength="1048576" maxArrayLength="2097152" />
          </binaryMessageEncoding>
          <httpTransport maxReceivedMessageSize="2162688" authenticationScheme="Anonymous" useDefaultWebProxy="false" />
        </binding>
        <binding name="TLAPIServiceHttpsBinding">
          <security authenticationMode="IssuedTokenOverTransport" />
          <binaryMessageEncoding>
            <readerQuotas maxStringContentLength="1048576" maxArrayLength="2097152" />
          </binaryMessageEncoding>
          <httpsTransport maxReceivedMessageSize="2162688" authenticationScheme="Anonymous" useDefaultWebProxy="false" />
        </binding>
      </customBinding>
    </bindings>
  </system.serviceModel>
  <system.webServer>
    <security>
      <authentication>
        <anonymousAuthentication enabled="true" />
        <windowsAuthentication enabled="false" />
      </authentication>
    </security>
  </system.webServer>
</configuration>
È stato utile?

Soluzione

It is not mapping $SharePoint.Project.AssemblyFullName$ to the actual AssemblyFullName value so it is including that as a literal string. Put in the actual value for the assembly and it will work.

Alternatively you can check this article out about Replaceable Parameters and how to get your project tokens to render for files outside of the Package and Manifest files. http://msdn.microsoft.com/en-us/library/ee231545.aspx

Altri suggerimenti

Adding the TokenReplacementFileExtensions ellement shown in the previous post to my .csprog file worked for me as I had a similar issue with my SharePoint 2010 service application recieving the "There are no addresses available for this application". Thank you!

It turns out all I needed was <TokenReplacementFileExtensions>svc</TokenReplacementFileE‌​xtensions> in my csproj file of the service application. Even though Visual Studio puts a blue squiggly line under the TokenreplacementFileExtensions element saying its invalid, it seems to work.

So Mike Oryszak was correct in with his alternate explanation with the Replaceable Parameters article and I will mark his answer as so.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top