Could not load assembly in 2012 for samples

Jul 3, 2013 at 5:29 PM
Hi Mark,

I am trying to open the samples from the itapi3_Binaries Samples folder in VS2012.
It converted with some warnings.

I have added the reference to the file iTapi3.dll in bin\debug folder and the project "IncomingSample" have built fine.
But when I try to run it, I get error saying:

"Could not load file or assembly 'ITapi3, Version=1.0.0.3, Culture=neutral, PublicKeyToken=36377d9f6f1f4883' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect...."

Any idea why it is so?
Thank you in advance!
Coordinator
Jul 3, 2013 at 6:37 PM
I'd guess the source project has a dependency against an older version of the DLL. Try removing the reference and re-adding it to the one you have now.

Mark Smith

[email removed] | @marksm | 214-774-4749 | www.julmar.com/blog/mark



Jul 3, 2013 at 7:35 PM
I removed the reference and added the reference from the bin\debug folder of the sample project.

Did not help, unfortunately.
None of the sample projects would run for me here. They all build okay, but won't run.


I assume someone already ran it on VS 2012, so it could not be because of the VS version?
Also, I am running Windows 8. Could it be related?
Coordinator
Jul 3, 2013 at 7:50 PM
No, those aren't issues. Make sure the apps are being built for x86, not Neutral; ITapi3 only runs for 32-bit apps. perhaps that's why it won't load. Also, try copying the .dll outside the bin/debug folder and add the reference to that (i.e. a dependencies folder for example).

mark

Mark Smith

[email removed] | @marksm | 214-774-4749 | www.julmar.com/blog/mark



Jul 3, 2013 at 8:06 PM
That did it!

I was building for "Any CPU".

Thank you, Sir!

(Your prompt response saved me a weekend! Much appreciated.)
Jul 3, 2013 at 8:25 PM
Edited Jul 3, 2013 at 8:39 PM
This worked for the atapi.dll samples.


The samples with Itapi3.dll did not get corrected. Still have the same error.

Any more Ideas to try?
Jul 3, 2013 at 9:17 PM
Your advise worked.

I downloaded the source in C++ and re-created the .DLL.

Thank you again!
Coordinator
Jul 3, 2013 at 10:21 PM
Perfect! Have a great weekend!

Mark Smith

[email removed] | @marksm | 214-774-4749 | www.julmar.com/blog/mark



Jul 5, 2013 at 3:26 PM
Mark -

I am still trying to make the samples work.

In the some samples there is using JulMar.tapi3 - could you tell me where to find it? It is not included in any of the samples.

This link from you blog is missing:

http://www.julmar.com/samples/tapi3wrapper.zip

(physical path E:\web\julmarcom00\htdocs\samples\tapi3wrapper.zip)

Thank you!
Coordinator
Jul 5, 2013 at 3:55 PM
TAPI3 wrapper moved to itapi3.codeplex.com and was open sourced.

There are no samples beyond what's on codeplex for simple tests - we ended up not using this as the client decided not to use TAPI because of the complexity.

mark



Jul 5, 2013 at 5:20 PM
So, where in a sample app (conversationrecord) you have "using JulMar.Tapi3;", what do I put in place of this "using"?

I am referencing iTapi3 already in this project, but can't replace "using JulMar.Tapi3;" with "using iTapi3;" - (I tried that.)
Coordinator
Jul 5, 2013 at 5:40 PM
Why would you need to replace it? The namespace is JulMar.Tapi3 according to the source code. It's a C++ assembly, but it's managed code so the normal .NET namespace rules would apply..

mark
Jul 5, 2013 at 7:55 PM
It won't build the solution. The JulMar is underlined in the "using JulMar.Tapi3;" and it says "Namespace JulMar could not be found."


Marat.
Coordinator
Jul 5, 2013 at 8:02 PM
Means you don't have a proper reference to ITAPI3.dll

Mark Smith

[email removed] | @marksm | 214-774-4749 | www.julmar.com/blog/mark



Jul 5, 2013 at 8:20 PM
Edited Jul 5, 2013 at 8:22 PM
I think I do.

ITapi3 is in the project references.
I reference the iTAPI3.dll file in a separate folder, not in bin/debug folder.

What else do I need to reference it properly?
I loaded the sample project, didn't change anything in it, except updated the reference location and made it build for x86.
Coordinator
Jul 5, 2013 at 8:22 PM
Not sure - I think that's it.. but if the namespaces don't resolve something is definitely wrong - the source from codeplex shows it there.

Mark Smith

[email removed] | @marksm | 214-774-4749 | www.julmar.com/blog/mark



Jul 5, 2013 at 8:38 PM
Well, I just copied things from your sample project into a new project, "gradually" building, and now it builds fine.

I can't see any differences, though, between the two projects.

Just one of those things perhaps - it's for no reason.