I’m not sure what that exception means but your best bet in tracking down the problem would be to do like I said before and set breakpoints throughout various parts of your code and step through using the debugger to see if you can catch the problem code.
For your second question, do you mean you want admob to notify you in lua when an ad as been shown or you want to call a lua method and check to see if an ad has been shown?
The latter you can just add another C# listener like the other ones you setup in the tutorial and have it return true if admob showed an ad or false if not.
It would be awesome if you could include the code examples for determining if an ad had shown in your tutorial. I have never programmed in C# so I would be very thankful if you could add it to the tutorial.
Thanks for your tutorial Spacewolf. I can run the sample project without any issues.
When I try to apply your tutorial steps to my own project however, I get the following errors in Visual Studio Express 2013 for Windows Update 3:
The type or namespace name ‘InterstitialAdControl’ could not be found (are you missing a using directive or an assembly reference?)
The name “LocalizedStrings” does not exist in the namespace
Any idea what the underlying cause could be? The project runs fine (although without ads) when not applying the steps described in the tutorial.
One difference between the sample project and mine I’ve noticed is that my .sln and .suo files are in a directory higher than de files of the rest of my project. However, simply moving the .sln and .suo files to the same dir as the rest of the files causes the project to be unusable.
The first error means the compiler can’t find the class definition for your InterstitialAdControl class.
Open InterstitialAdControl.cs - after the using statements at the top of the file you should see a line something like “namespace xxxxxxxxxxxxxxx”. This line declares the namespace of the class. The namespace should match the rest of your project namespace. For example, if your project were named “ShooterGame”, than this line should look like “namespace ShooterGame”. You can open up MainPage.xaml.cs and look at the namespace line there. The namespace line in InterstitialAdControl.cs should match that.
I’ve updated the tutorial to fix this problem. Thanks for bringing it up!
It actually doesn’t matter where the solution files are located. When you created the project, you can choose to have the solution files in their own directory or in with the project files (specified by checking a box next to this option or not in the create project dialog.)
The file is being blocked by Windows, as downloaded content is deemed unsafe. The solution is to right-click on the unpacked monitor file, select Properties, and click Unblock.
Error 1 Retrieving the COM class factory for component with CLSID {2D0A16C9-53D9-42C1-BCC2-8D2A135E2163} failed due to the following error: 8001010e The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)). 0 0
Did you download, compile, and run the sample application? If so it should run as-is.
If you are you are trying to integrate the admob code into a different project then I would need to see your code. Can you track down the line of code and method that is throwing the exception your getting?
First I tried it in my own project and when I got the error I did it on your download example and get the same error. How do I track down the line of code and method that is throwing the exception?
FYI … I am using Visual Studio Express 2013 and Corona Cards 2506
You could try setting breakpoints at various places in the C# code and then stepping through with the debugger and see exactly when the exception gets thrown.