none
Could not load file or assembly of svc file in the iis 5.1

    Question

  •  HI All,

     

      sorry for pasting all my error details.  I tried to host the  application which we get in .net 3.0 wcf project with service1, datacontract1 and Iservice1. Have a look at it

    namespace FireQService

    {

    [ServiceContract()]

    public interface IService1

    {

    [OperationContract]

    string MyOperation1(string myValue);

    [OperationContract]

    string MyOperation2(DataContract1 dataContractValue);

    }

    public class service1 : IService1

    {

    public string MyOperation1(string myValue)

    {

    return "Hello: " + myValue;

    }

    public string MyOperation2(DataContract1 dataContractValue)

    {

    return "Hello: " + dataContractValue.FirstName;

    }

    }

    [DataContract]

    public class DataContract1

    {

    string firstName;

    string lastName;

    [DataMember]

    public string FirstName

    {

    get { return firstName; }

    set { firstName = value; }

    }

    [DataMember]

    public string LastName

    {

    get { return lastName; }

    set { lastName = value; }

    }

    }

    }

     

    After that I configured my web.config file as follows:

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

    <system.serviceModel>

    <services>

    <service behaviorConfiguration="NewBehavior" name="FireQService.service1">

    <endpoint address="" binding="basicHttpBinding" contract="FireQService.IService1" />

    </service>

    </services>

    <behaviors>

    <serviceBehaviors>

    <behavior name="NewBehavior">

    <serviceMetadata httpGetEnabled="true" />

    <serviceDebug includeExceptionDetailInFaults="true" />

    </behavior>

    </serviceBehaviors>

    </behaviors>

    </system.serviceModel>

    <system.web>

    <identity impersonate="true" />

    </system.web>

    </configuration>

     

     

    After that I have created a svc file as follows:

    <%@ServiceHost Service="FireQService.service1" %>

    %@Assembly Name="FireQService" %

     

    and saved it as sample.svc

     

    after that I have created a virtual folder and pointed the path to my local folder where i was working.  Then I tried to browse the .svc file which is under my virtual folder.  Then i got this exception : Can any body clarify this Please.

     

    Server Error in '/FireQService' Application.


    Could not load file or assembly 'FireQService' or one of its dependencies. The system cannot find the file specified.

    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.IO.FileNotFoundException: Could not load file or assembly 'FireQService' or one of its dependencies. The system cannot find the file specified.

    Source Error:

    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.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'FireQService' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    

    Stack Trace:

    [FileNotFoundException: Could not load file or assembly 'FireQService' or one of its dependencies. The system cannot find the file specified.]
       System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
       System.Reflection.Assembly.Load(String assemblyString) +25
       System.ServiceModel.Activation.ServiceParser.ProcessDirective(String directiveName, IDictionary directive) +476
       System.ServiceModel.Activation.ServiceParser.ParseString() +165
       System.ServiceModel.Activation.ServiceParser.Parse(ICollection referencedAssemblies) +131
       System.ServiceModel.Activation.ServiceBuildProvider.get_CodeCompilerType() +60
       System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +54
       System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +256
       System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +29
       System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +279
       System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +580
       System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93
       System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +55
       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +50
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +31
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +445
    
    [ServiceActivationException: The service '/FireQService/Sample.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not load file or assembly 'FireQService' or one of its dependencies. The system cannot find the file specified..]
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +962
       System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) +419
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() +260
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() +760
       System.ServiceModel.Activation.HostedHttpModuleRequestAsyncResult.BeginRequest() +178
       System.ServiceModel.Activation.HttpModule.StartBeginProcessRequest(Object sender, EventArgs e, AsyncCallback cb, Object extraData) +70
       System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +195
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    

    Wednesday, January 23, 2008 2:53 PM

Answers

  •  

    finally i found the answer that , I have to give my service build path to bin but not bin\debug. Because IIS will not recognize the dll`s under the debug folder we should give the build path to bin only.

     

    Happy coding.

    Thursday, January 24, 2008 2:35 PM

All replies

  •  

    finally i found the answer that , I have to give my service build path to bin but not bin\debug. Because IIS will not recognize the dll`s under the debug folder we should give the build path to bin only.

     

    Happy coding.

    Thursday, January 24, 2008 2:35 PM
  • How did you set the build path. I can't find the option and I'm having a similar problem. Thanks.
    • Proposed as answer by .net_Power Monday, June 29, 2009 8:37 AM
    Thursday, April 16, 2009 8:38 PM
  • Just Right Click On The SampleApplicaton and click on the Option Properties  and u will get the Screen. There u can find Build tab Which is Selected By Default, and there u will get the option Output Path there u can change it into the bin\

    Monday, June 29, 2009 9:07 AM