Page 1 of 2

Missing DLL?

Posted: Fri Aug 16, 2019 1:26 pm
by ShawnALaw
I've come across a very strange error that I can't seem to track down.
We have a development server and a production server for SoftPro.
I've built an API to communicate with the SoftPro server.
When I connect to the development server, everything works fine. When I connect to the production server, I get the error:
Could not load file or assembly 'Microsoft.AI.ServerTelemetryChannel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
on the line:

Code: Select all

if (!ss.TryAuthenticate(out reason))
in:

Code: Select all

string username = ConfigurationManager.AppSettings["SoftProUser"];
string userpassword = ConfigurationManager.AppSettings["SoftProPassword"];
string softprodomain = ConfigurationManager.AppSettings["SoftProDomain"];
string softproserver = ConfigurationManager.AppSettings["SoftProServer"];
errorMessage = string.Empty;

NetworkCredential creds = new NetworkCredential(username, userpassword, softprodomain); //"pekappd06");
using (SelectServer ss = new SelectServer(new Uri(softproserver), creds))
{
	string reason;
	if (!ss.TryAuthenticate(out reason))
	{
		errorMessage = reason;
		return null;
	}
Where the only difference is the IP being pointed to in
ConfigurationManager.AppSettings["SoftProServer"]
Does anyone have any ideas?
No one can find a difference between the two servers file-system-wise.
I have the DLL in both bin and ./ of the API locally. The DLL exists in the same place remotely on both servers. Is there any way to get any more information on this? Thanks in advance.

Re: Missing DLL?

Posted: Mon Aug 19, 2019 3:58 pm
by BobRichards
The referenced DLLs should be in the same folder as your executable in order to be found.
  • Does the FileNotFoundException have any additional information in it such as Inner Exception?
  • Are all DLLs on the same version?
  • If you bring the production server DLLs to your client machine, does the application continue to work?

Re: Missing DLL?

Posted: Tue Aug 20, 2019 11:39 am
by ShawnALaw
The dlls on the servers appear to be the same, and in the same location.
I'm not catching an exception. the method "SelectServer.TryAuthenticate" has a string out parameter that is returning the error. There doesn't seem to be any overloads that would allow me to catch an exception.
I currently have the people with access to the server trying to copy the DLLs from production to development to see if the error starts happening there.
I'll post results of that when I get them.

Re: Missing DLL?

Posted: Wed Aug 21, 2019 10:17 am
by ShawnALaw
I tried replacing the DLLs on my local machine and the dev machine with the ones from production. There was no difference. I did the entire folders worth of DLLs.

Re: Missing DLL?

Posted: Fri Aug 23, 2019 7:58 am
by yatin.t
Try this if you haven't already: Check the CLR Exceptions flag on the Debug->Exception Settings window of Visual Studio so you can catch an unhandled exception that is most likely being thrown here. Please attach the call stack when you catch that exception so we can troubleshoot this better.

Re: Missing DLL?

Posted: Fri Aug 23, 2019 12:48 pm
by ShawnALaw
Nothing was thrown. It is being caught and handled by the SelectServer.TryAuthenticate method and I'm not able to see what's going on inside of that method.

I did, however, turn ALL exceptions on, and do see a lot of IO errors:
Managed Debugging Assistant 'LoadFromContext' has detected a problem in 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.x86.exe'.

Additional information: The assembly named 'Microsoft.ApplicationInsights' was loaded from 'file:///*hidden*/SoftProApps/SoftProApps.WebServicesTests/bin/Debug/Microsoft.ApplicationInsights.DLL' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.


Could that possibly be the issue? I'm going to try that and see if it changes anything.

Re: Missing DLL?

Posted: Fri Aug 23, 2019 3:11 pm
by yatin.t
I'd be surprised if the MSTest execution engine IO error is related to the problem. What version of Select are you running this code on?

Also, Fusion Log Viewer should tell you the location from where the AppDomain is trying and failing to load the Microsoft.AI.ServerTelemetryChannel.dll. This utility should be installed with VS already. Please give this a go and let me know what you find.

Re: Missing DLL?

Posted: Thu Jan 19, 2023 3:22 pm
by bcole
Did you all ever find a solution to the problem. In 2023, I am facing the same exact issue when going from our DEV environment to UAT. Any help would be much appreciated.

Re: Missing DLL?

Posted: Thu Jan 19, 2023 4:47 pm
by BobRichards
I never heard anything else. What version of Select are you using and what issues are you seeing?

Re: Missing DLL?

Posted: Thu Jan 19, 2023 4:55 pm
by bcole
We are using SoftPro Select Version: 4.3.60210.119.
The error message is the following:
Could not load file or assembly 'Microsoft.AI.ServerTelemetryChannel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I have this working like a charm on two different servers in one of our DEV environments. I copied all files and tried this in another DEV environment and I get the error above. Of course the Instances are two different instances of SPS in the different environments, but they are the same version.