WCF and Services not quite working

Discussion in 'Site Programming, Development and Design' started by TruthBeKnown, Jan 29, 2010.

  1. I am getting an error "Load operation failed for query 'GetUser' ...... NotFound" at first reference to the website after that the 'GetUser' changes to 'login' when trying to logon with a valid user name.

    The site works perfectly when executing it on my localhost. From my localhost, I can logon and out and register users and all data is written to the Winhost installed SQL Server Database. I have copied every dll in my project to the bin folder but still the same error. From all posts on line, I should only have to copy about four of them.

    Anyone have an idea about what I am still missing?

    I have solved many errors if anyone still needs help, I can post more details but here is a summary so far:

    1. Copied between four and 20 DLLs to bin folder.
    2. Implemented a custom DomainHostFactory
    3. Set all services to use the new DomainHostFactory
    4. Added <trust level="Full" /> to Web.config
    5. Set connectionString as follows:

    <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=<SQLSERVER>;Integrated Security=false;Initial Catalog=<DB>;User ID=<USERID>;Password=<PASSWORD>" providerName="System.Data.SqlClient" />
    </connectionStrings>

    6. Authentication <authentication mode="Forms" />
    7. ASP Setting <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    8. All Nov09 Breaking changes implemented
    http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=3570

    What did I miss?
     
    Last edited by a moderator: Oct 14, 2015
  2. Yep, sounds like my problem. I just finished converting my entire project to a compiled webpage in hopes that maybe the generated code won't have whatever glitch the server's version of ASP.NET has (supposing that there is one), but that didn't work either.

    It might still be the .NET/ASPX version that's causing an issue, but I'm really completely out of ideas.
     
  3. Ray

    Ray

    Did you check if 'GetUser' is an object on your database. Maybe it's looking for a stored procedure or table with the name of 'GetUser' and it can't find it.
     
  4. Shared bin and App_Code folder

    While browsing the service allowed me to discover that my CustomServiceHostFactory class is not being found. I have all my service related files in the Services folder and when browsing any of them, RIA and other assemblies are not found. As a test, I copied my dependent assemblies into /Services/bin from /bin and then all but my CustomServiceHostFactory class was found. This assem is located in my web namespace DLL. At this point I could copy this into the other bin folder as well, but it seems wrong to have to duplicate all of these DLLs. I read the msdn page about shared folders (/bin and /App_Code) and it doesn't seem to be working as documented. The /bin and /App_Code folders suppose to be usable by the whole web site, but it is not.

    Is there some special way to tell services located in /Services/MyService.svc to look in /bin for all dependent files?

    The following settings are examples from my SVC file. I found an example where the service and factory were kept in the same file and specified by the CodeBehind setting. I would like to keep the factor code in its own file.

    Service="NAMESPACE.ServiceName" works while

    Factory="NAMESPACE.CustomServiceHostFactory" cannot be found.
     
  5. Ray

    Ray

    Do you have the folder Services as an application folder. With application level and inheritance in ASP.Net, the way your application will look for an assembly or component can get fairly complicated.
     
  6. I do not. If it needs to be set, I believe through IIS Manager, what should the name and value be?

    Name=Value => Services=/Services ?

    I understand virtual directories, but don't fully understand Application folders. Does this just mean that the application, service application in this case, is part of the overall web site?

    Thanks,
     
  7. Ray

    Ray

    You set the folder as an application folder within the Winhost control panel under the Site Info Manager/Application Starting Point.

    I see many confusion with virtual folders and application folders. I see most of the time they are confused with one or the other. Basically your root is an application folder. If you want to have another web application were it will look to its own web.config file and load its own assemblies or components, you will create a folder under the root using FTP and then use the control panel to set it as its own application starting point.

    http://support.Winhost.com/KB/a635/what-is-the-application-starting-point-tool.aspx
     
    Last edited by a moderator: Oct 14, 2015
  8. My confusion with this is that my svc files are services which should all be bundled up with the root application /. All the dependencies for these services are located in /bin. If I set another application starting point, do I also have to duplicate my web.config and bin folders in /Services?
     
  9. Ray

    Ray

    I had the impression that the folder Services was setup as it's own application meaning that inside this folder (Services) it had a web.config file, a folder Bin, and a folder App_Data among the few. If this is the case then yes, you should setup the subfolder Services as its own application starting point.
     

Share This Page