whiteElephant
whiteElephant

Reputation: 263

c# Inner Exception, Could not load type

I have a webservice that processes push notifications, After rebuilding it, it now crashes when I start it. In the log this is the stack trace I get the following:

Stack Trace at JDS.Booj.Mobile.MySqlStorageProvider.Providers.BoojMobileStorage.<>c__DisplayClasse6.<FindOrCreateEnvironment>b__e4(MySqlConnection connection) in d:\TeamCityWork\a1d7899dc094839e\MySqlStorageProvider\Providers\BoojMobileStorage.cs:line 125
   at JDS.Booj.Mobile.MySqlCommon.MySqlDatabaseUtils.RunInConnection(String connectionString, CodeToRunInConnection code) in d:\TeamCityWork\a1d7899dc094839e\MySqlCommon\MySqlDatabaseUtils.cs:line 334
   at JDS.Booj.Mobile.MySqlStorageProvider.Providers.BoojMobileStorage.FindOrCreateEnvironment(BoojMobileEnvironment environment) in d:\TeamCityWork\a1d7899dc094839e\MySqlStorageProvider\Providers\BoojMobileStorage.cs:line 139
   at JDS.Booj.Mobile.Library.Environments.EnvironmentOperations.CreateCurrentEnvironmentIfNotExists() in c:\Users\connl1\Documents\bitbucket\booj-mobile-server\Library\Environments\EnvironmentOperations.cs:line 113
   at JDS.Booj.Mobile.Library.MobileDatabaseHelper.InitializeDatabase() in c:\Users\connl1\Documents\bitbucket\booj-mobile-server\Library\BoojMobileDatabaseHelper.cs:line 41
   at JDS.Booj.Mobile.Library.BoojMobileStartup.MobileInitialize() in c:\Users\connl1\Documents\bitbucket\booj-mobile-server\Library\BoojMobileStartup.cs:line 117
   at JDS.Booj.Mobile.Library.BoojMobileStartup.DoInitialization() in c:\Users\connl1\Documents\bitbucket\booj-mobile-server\Library\BoojMobileStartup.cs:line 96
   at JDS.Booj.Mobile.Library.BoojMobileStartup.Initialize() in c:\Users\connl1\Documents\bitbucket\booj-mobile-server\Library\BoojMobileStartup.cs:line 70
Inner Exception: Could not load type 'JDS.Booj.Mobile.Common.SqlBuilder.SqlBuilder`1' from assembly 'JDS.Booj.Mobile.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null'.
Source: JDS.Booj.Mobile.MySqlStorageProvider
Stack Trace:    at JDS.Booj.Mobile.MySqlStorageProvider.DataMappers.BoojMobileMappers.BoojMobileEnvironmentMapper..cctor()

From what I can tell it is trying to call some methods in the wrong directory (i.e anything under d:\teamcitywork), but this directory does not exist.

In Solution Explorer, the path is set to the correct files, so I am at a loss.

Does anyone know how to point it to the right files or fix the problem?

Upvotes: 1

Views: 658

Answers (1)

Karl Anderson
Karl Anderson

Reputation: 34844

You are seeing the d:\teamcitywork path, because the PDBs were deployed, which means someone either built in debug mode and deployed (more likely) or inadvertently copied them to the server (less likely).

As for Could not load type error message, can you verify that the correct version of the JDS.Booj.Mobile.Common DLL is deployed to the server? My guess is that it is either missing or the wrong version is on the server and it is causing this error to happen.

UPDATE:

Is common.dll a file that you have the source code for? It sounds like the JDS.Booj.Mobile.Common.SqlBuilder namespace is either not in the deployed version of the DLL or it has been changed in some way that makes it unable to be loaded.

Do you have Reflector or ILSpy? These tools will allow to decompile a DLL and see the logic inside of them. Then you can compare the SqlBuilder type in the deployed code with what is on your machine.

Upvotes: 1

Related Questions