I'm trying to build my very first SP (2010) Sandbox project (I'm generally new to SP anyway!) but I keep hitting the following "infamous" error when I try and add any of my custom Web Parts to a page:-
Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: $Resources:core,ImportErrorMessage;
I've read numerous articles online that this is normally to do with the issues like trying to use references to classes prohibited by the Sandbox. What's odd though is that even if I introduce a completely empty Web Part and try and deploy this I either get that error above or this appearing in the Web Part's page location instead of the WP:-
Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: The type is not registered as safe.
Debug doesn't seem to work for me at the moment either. If I try to run it I either get:-
a) Visual Studio telling me my code is not the same as the version currently running - which 9 times out of 10 it is!
or
b) That the first error is being thrown before I even hit the Web Part code and my breakpoints are ignored.
A bit of background on the project might help:-
I've setup the following structure...
- Project1
- Project2
- Core (Common Project Assets)
Project1 and Project2 inherit from the functionality setup in the Core.
Introduction of the 2nd project and the core seems to have been when the issues started to appear but again the empty Web Part of Project1 doesn't call anything from Core so I'm not 100% that's where the problem lies.
Each project is defined as a Sandbox solution. Each Web Part is a standard one, not a Visual or a Visual (Sandboxed).
It was mentioned that separate Solutions trying to communication might be an issue so I've refactored and am now deploying all my projects under one, separate WSP.
I've checked that the AssemblyInfo includes a reference to [assembly: AllowPartiallyTrustedCallers()] and that's on all the projects.
I've tried clearing out the Solution, changing the Assembly version numbering before deployment nothing makes a difference.
So I'm now at a point where I'm not sure what else to try and Googling isn't giving me much luck either. Does anyone have any ideas?
Thanks in advance, James