Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to make Sandbox Visual Web Part using Power Tools.

It has given me below error :

Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's
Execute method in the partial trust app domain: An unexpected error has occurred.

The error came when I try to add below two lines (except below two lines of code, nothing else in the web part) Any idea how to resolve it? I mean just for below two lines of code, why should one go for farm.

ExchangeService service = new  ExchangeService(ExchangeVersion.Exchange2010);            

service.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

There have been similar cases with similar web part, I have developed Visual Web Part in Sandbox, it got worked fine, I deploed it, it worked for a day or so and the next day, it has started giving the same error!!

share|improve this question
add comment

1 Answer

ExchangeService class calls webservices and it's not allowed in Sandbox. You can deploy sandboxed visual web part in Full Trust and call Exchange Services.

If you are creating Visual Web Part you can't deploy it to Sandbox.

share|improve this answer
    
Could you please help me understanding how can I deploy my Visual Sandbox in Full Trust?? Thanks –  NICK Oct 18 '12 at 7:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.