locked
How to resolve Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. RRS feed

  • Question

  • User-1167631307 posted

    How to resolve this exception in asp.net core

    Tuesday, July 28, 2020 7:57 AM

All replies

  • User1120430333 posted

    How to resolve this exception in asp.net core 

    You need to find the Sysytem.Web.Services DLL based on its version number and publickey token and place it in the Bin folder so that the program can find it. Where is the DLL? Why is it not in the Bin folder is what you  have to figure out.

    https://docs.microsoft.com/en-us/dotnet/api/system.web.services.webservice?view=netframework-4.8

    You can use Nuget possible to install the DLL by its version number.

    Tuesday, July 28, 2020 1:19 PM
  • User-1167631307 posted

    Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. 

    this dll is used in class library which is built in .NET 4.8 and and this class library referenced in .NET Core 

    Please also provide Nuget name 

    Tuesday, July 28, 2020 1:33 PM
  • User475983607 posted

    Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. 

    this dll is used in class library which is built in .NET 4.8 and and this class library referenced in .NET Core 

    Please also provide Nuget name 

    As stated in your other thread, the library is not compatible with ASP.NET Core.  You'll need to stick with .NET to use the very old library.

    Tuesday, July 28, 2020 1:53 PM
  • User1120430333 posted

    I

    kalva

    Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. 

    this dll is used in class library which is built in .NET 4.8 and and this class library referenced in .NET Core 

    Please also provide Nuget name 

    As stated in your other thread, the library is not compatible with ASP.NET Core.  You'll need to stick with .NET to use the very old library.

    I would think that it would be more than a 'not found' exception being thrown if the assembly was not compatible with .NET Core. Right now,  the exception thrown is that the program manifest can't find the DLL based on version number and publickey token.

    Tuesday, July 28, 2020 4:18 PM
  • User1120430333 posted

    Please also provide Nuget name 

    System.Web.Services is the name of the DLL if you look at the provided documentation link in the first reply post.

    Tuesday, July 28, 2020 4:22 PM
  • User475983607 posted

    I would think that it would be more than a 'not found' exception being thrown if the assembly was not compatible with .NET Core. Right now,  the exception thrown is that the program manifest can't find the DLL based on version number and publickey token.

    Click on your original link and select any of the Core versions from the list.  The library is only available in .NET.  Also, Core 3.x is not compatible with .NET.

    Tuesday, July 28, 2020 4:37 PM
  • User-1167631307 posted

    basicInvoke parameters = new basicInvoke();
    parameters.scopeCoordinateIds = LBCTConfigurationManager.SharedInstance.GetConfigurationValueAsString("LBCT/LBCT/LBCT/LBCT");
    parameters.xmlDoc = xml;

    LBCTArgoWebService service = new LBCTArgoWebService(username, password);

    _logger.Info("service.Url=" + service.Url);

    int timeout = LBCTConfigurationManager.SharedInstance.GetConfigurationValueAsInt("1200", -1);

    service.Timeout = timeout == -1 ? -1 : timeout * 1000;

    service.Url = LBCTConfigurationManager.SharedInstance.GetConfigurationValueAsString("http://n4tst.lbct.llc/apex/services/argobasicservice");

    _logger.Info("Url (from config) =" + service.Url);

    basicInvokeResponse response = null;

    try
    {
    response = service.basicInvoke(parameters);
    }
    catch (Exception e)
    {
    _logger.Info("Exception=" + e.Message);
    _logger.Info("StackTrace=" + e.StackTrace);

    throw e;
    }

    string result = response.basicInvokeResponse1;
    //string result = string.Empty;

    _logger.Debug("received response xml='" + result + "'");

    stopWatch.Stop();

    _logger.Info("elapsedMilliseconds=" + stopWatch.ElapsedMilliseconds + " elapsed=" + stopWatch.Elapsed + " user=" + username + " request=" + xml + " response=" + result);

    return result;

    Wednesday, July 29, 2020 6:42 AM
  • User-1167631307 posted

    please help me above code is throwing system.web.services exception when its referring from .net core 

    Wednesday, July 29, 2020 6:43 AM
  • User1116182075 posted

    1 ) .dll properties path set true

    2) unistall and install again

    Wednesday, July 29, 2020 9:13 AM
  • User475983607 posted

    Correct me if I'm wrong but the reference documentation clearly and openly states that System.Web.Services is not part of the .NET standard or .NET Core.  The library cannot be used in a Core project.  It seems your experiment proves this.

    https://docs.microsoft.com/en-us/dotnet/api/system.web.services.webservice?view=netframework-4.8

    Use the "connected services" feature if you need to create a proxy.

    https://docs.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide

    Wednesday, July 29, 2020 11:49 AM