Error in an Outlook addin 2010 - visual-studio-2010

I have developed an Outlook addin where a ribbon will be loaded while opening 'Appoinment' window.
While running the application, the ribbon works fine. But if I open any mail item, it prompts the following error message.
'Error occurred while calling the callback ribbon_getdcvisible'
I am able to disable the error message, but I want to know how to get rid of this error permanently without disabling the error message?

Make sure your callback methods exist in correct assembly and accepts the correct parameters. In your case the callback method should look like following.
public bool ribbon_getdcvisible(IRibbonControl control)
{
// your code here.
}

Related

Hello.js MSAL usage in Office Web Add-in Issue

I'm using the hello.js for MSAL Microsoft Active Directory Library to authenticate a user for a Word Office web add-in. It works great up to returning to my original window.
Here's my basic setup
Call a dialog pop up in Word web add-in then in that popup use the loginRedirect promise function.
Works great! I authenticate using my APPid and tenant ID.
One observation is it requires a HTTPS reply redirect URL!!!!
However when it returns after successful login I get few errors in my dev tool console
First it cannot find an html element and it returns null or undefined
Second I saw a Unable to get property 'then' of undefined or null reference when I clicked signIn() and ran the loginRedirect function
This hello.js library is from the https://github.com/AzureAD/microsoft-authentication-library-for-js
Please let me know why I'm getting null or undefined when using var divWelcome = document.getElementById('WelcomeMessage'); ?
I solved this by restructuring my code and isolating the issue. There was an error that was preventing full processing. The MSAL Hello.js library works very well even for Office Add-ins!

Classic ASP Error Handling: Calling a function after an error?

I do maintenance on a classic ASP website that basically has no error handling at all yet. So users see any error message that comes across... Instead, I would like my code to be able to catch any potential error and then fire off an email before redirecting the user to a more friendly error-page.
This website is rather large, and every webpage comes with the same include file at the beginning... So ideally, I would like to set an error handler from the beginning of this include file. I haven't had any luck finding a way to do this without having to go through every page individually having error handling happen at the end of the script... Is there a possible way to code something like this from the include file?:
' Include file contents:
Function MyHandler()
'Code for triggering email goes here
response.redirect "ErrorPage.asp"
End Function
On Error call MyHandler()
Thanks in advance!
I suggest to use Custom Error Pages in IIS (Web Server), if you have access to those. You can redirect different types of errors to different scripts if you like or point them all to a single one and have there the logic for all error codes.
You can catch common errors there and maybe redirect the user to a alternative page/site, or return a specific error message.. I would suggest to use the custom error page also to log the error and some information from the session (e.g. form submit data, query strings, referrer URLs, cookies etc.) in a database and/or send a notification email to some service account to identify specific issues that are occurring and then also have something to go on to actually fix the cause of many of the errors.

Microsoft.SharePoint.WebControls.SPRibbon not Working In Sharepoint SandBox Solution?

I wanna create Contextual Tab using Webpart In Sandbox Solution..that time I am getting Error as below When i am added Custom-Webpart :
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.
In My Webpart's Code
Microsoft.SharePoint.WebControls.SPRibbon.GetCurrent(this.Page).MakeTabAvailable("MyProject.Ribbon.HelloTab");
Is there another way to Solution To create Custom Ribbon Tab?
Altering the ribbon is not permitted from within the sandbox. You have to options available to you.
Make your solution a farm solution (thereby giving it the necessary permissions)
Use a sandbox proxy the perform the steps on the ribbon (see MSDN)

Displaying Error Page in WP7 app

Just want to check I have not missed anything obvious. There is no way to Navigate the user to a "ooops something bad has happened" page from the UnhandledException handler is there?
What is everyone else doing
I know I can "handle" the error and popup up messagebox but I would prefer a whole page offering them the oppurtunity to file a bug report.
The samples I have seen simply set the RootFrame directly but I have seen that just makes for a messy UI with what looks like a Page displayed on top of another page
TIA
Pat
If you get an UnhandledException it occurs while your applicaiton is about to be shut down. The best you can do in this situation is warn the user that something went wrong (using a messagebox or similar) but be prepared that this may not be displayed to the user for long, depending on the actual exception.
Rather than try and continue executing application functionality when an unhandled exception occurs, simply save the details of the exception. Then, when the application is next started, display a message to the user to indicate that "the last time that app ran there was a problem". You can also use this opportunity to send exception details to yourself/ your web reporting service so you can analyse the issues and fix/prevent them in a future version.
You can call RootFrame.Navigate(your errorPage) to navigate to your custom error page in the UnhandledException handler.
Basically, using a custom MessageBox to show a nice easy-going error info and providing an button to send bug report is very common. And this article is MSDN pointed out that errorinfo not be a separate page in best practice.

Error hosting Silverlight application page with WCF service

I am currently developing a Silverlight application with WCF service. The process flow of my project is as follows.
Silverlight page -> Service1.svc -> SQL Server 2008 and back
What my Silverligth page does is when a user clicks a button it calls a service reference (Service.svc). What the service is doing basically is to query a SQL database (SQL server 2008) and return the query back to the service and in turn the service returns the result back to the Silverlight page where it will be displayed.
When I am debugging and running the webpage from the visual Studio 2010 express all the things go according to plan i.e. when the user clicks the button the data that were acquired from the database are displayed.
But when I try to publish this and run it on Apache server or IIS I am getting an error when clicking the button. The web page is displayed correctly even from another internally connected PC, but the problem occurs when I press the button.
An error message is displayed as shown below:
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at SilverlightApplication11.ServiceReference1.DoWorkCompletedEventArgs.get_Result()
at SilverlightApplication11.About.client_DoWorkCompleted(Object sender, DoWorkCompletedEventArgs e)
at SilverlightApplication11.ServiceReference1.Service1Client.OnDoWorkCompleted(Object state)
-------------------------------->
I have abosolutley no idea on how to solve this. I am very new to this whole stuff please help I been stuck in this about a week now.
Any snippets of code you guys would like please comment so I can post it here.
Thanks in advance =)
The service call you're making has an equivalent event to tap into. Your handler will be called when the operation completes or fails. The event args passed to your handler will contain information about your error. Keep digging into inner exception until something makes sense.
Also, your silverlight's App.xaml.cs has the ability to do something when an exception is thrown. There's an event called UnhandledException you can tap into. From there, you can output more information for yourself about the InnerException. Sometimes the first exception is not helpful, but there will be an InnerException in the Exception that will have more detail.

Resources