WCF Memory error

Discussion in 'ASP.NET WebServices' started by eschneider, Mar 17, 2009.

  1. At first I was getting this problem "This collection already contains an address with scheme http"

    But after adding the hosting overrides and now I get the problem below.

    Anyone know whats going on?

    Thanks,
    Eric


    [InsufficientMemoryException: Memory gates checking failed because the free memory (397893632 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.] System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage) +11659999 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +468[ServiceActivationException: The service '/CouponService/ShopWize.CouponService.svc' cannot be activated due to an exception during compilation. The exception message is: Memory gates checking failed because the free memory (397893632 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element..] System.ServiceModel.AsyncResult.End(IAsyncResult result) +11531006 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75[/FONT]
     
  2. WCF Errors

    I just tried it again, and now it's back to ""This collection already contains an address with scheme http"
     
  3. Bruce

    Bruce DiscountASP.NET Staff

  4. Yes I'm looking at them.

    The app_code folder does not exist for me. And the only time I see the *.svc file is after publishing through VS on the hosting server (DASP). So I download the .svc file and modify it as best I can. But the app_Code folder does not exist, so I specified the location of the service file, but still does not work.

    Currently ast the following on DASP host:
    http://www.schneidersoft.com/couponservice/

    Any ideas?

    Eric

    I'm still stuck on this problem. The current error is below.

    I have tried changing the service many times, not sure what it needs.

    Any help would be great.

    Eric

    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Parser Error Message: The CLR Type 'MyServiceHostFactory' could not be loaded during service compilation. Verify that this type is either defined in a source file located in the application's \App_Code directory, contained in a compiled assembly located in the application's \bin directory, or present in an assembly installed in the Global Assembly Cache. Note that the type name is case-sensitive and that the directories such as \App_Code and \bin must be located in the application's root directory and cannot be nested in subdirectories.
    [/FONT]
     
  5. I pulled up your application and see some files that don't belong in a web application. When you create your web service application in Visual Studio 2008, don't select "New Project". You have to select "New Web Site", then select ".NET 3.5 Framework" in the framework selector, and then "WCF Service". This will create a proper ASP.NET WCF Web Service, which includes an App_Code folder.

    When uploading your application to the DiscountASP server, I recommend doing a "Copy Website" instead of "Publish". See this kb article: https://support.discountasp.net/KB/...ual-studio-20082005-visual-web-developer.aspx
     
  6. Thanks, I will give that a try, and post back.

    I get a different error now:
    Configuration Error

    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    Source Error:[/FONT]

    Line 85: ASP.NET to identify an incoming user.
    Line 86: -->
    Line 87: <authentication mode="Windows" />
    Line 88:
    Line 89: <customErrors mode="Off"/>
     
  7. WCF

    Ok , I enabled the folder as a Web App. New Error:

    Configuration Error

    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The entry 'ScriptModule' has already been added.

    Source Error:

    Line 111: </httpHandlers>
    Line 112: <httpModules>
    Line 113: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    Line 114: </httpModules>
    Line 115:
    Source File: E:\web\schneiderso\htdocs\couponservice\web.config Line: 113
    [/FONT]
     
  8. WCF

    After following this http://forums.asp.net/t/1074148.aspx
    I get the following below error.


    Configuration Error

    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Could not load file or assembly 'DotNetNuke.HttpModules' or one of its dependencies. The system cannot find the file specified. (E:\web\schneiderso\htdocs\web.config line 97)

    Source Error:

    Line 95: <httpModules>
    Line 96: <!-- add name="Authentication" type="DotNetNuke.HttpModules.AuthenticationModule, DotNetNuke.HttpModules.Authentication" / -->
    Line 97: <add name="Compression" type="DotNetNuke.HttpModules.Compression.CompressionModule, DotNetNuke.HttpModules" />
    Line 98: <add name="RequestFilter" type="DotNetNuke.HttpModules.RequestFilter.RequestFilterModule, DotNetNuke.HttpModules" />
    Line 99: <add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" />
    Source File: E:\web\schneiderso\htdocs\web.config Line: 97 [/FONT]
     
  9. This error has nothing to do with WCF anymore. It looks like you have DotNetNuke on your root. Remember that web.config settings are inherited to the sub applications, including what httpModules to load. Since your application doesn't contain any of the DotNetNuke DLLs in its bin, you will get this error. If you are going to have multiple, unrelated applications on your web site, it is best to deploy them in separate sub applications.
     
  10. Any idea how I do that?

    I would have though different folder would solve that problem.

    Looks as if DNN is in the root?

    I am willing to remove it, I can re-add it again later into a new folder.

    Is there some folders that should be save? Otherwise thinking of clearing out all the folders.

    Eric

    Also, I rename the DNN config to _1 to disable it, and now I'm back to :

    Parser Error

    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: The CLR Type 'MyServiceHostFactory' could not be loaded during service compilation. Verify that this type is either defined in a source file located in the application's \App_Code directory, contained in a compiled assembly located in the application's \bin directory, or present in an assembly installed in the Global Assembly Cache. Note that the type name is case-sensitive and that the directories such as \App_Code and \bin must be located in the application's root directory and cannot be nested in subdirectories.

    Source Error:

    Line 1: <%@ ServiceHost Language="VB" Debug="true" Service="ShopWize.CouponService" Factory="MyServiceHostFactory" CodeBehind="~/App_Code/CouponService.vb" %>
    Line 2:
    [/FONT]
     
  11. You should put the MyServiceHostFactory.vb in the App_Code directory.
     
  12. Thanks, I did that and also a few other web.config changes to remove namespaces and it seems to be working finally. What a pain in the ass...

    Thanks for all the help...

    Eric Schneider
     

Share This Page