ASP.NET FaceBook App Development - - c#

I have downloaded both samples for the Facebook Developer Kit from Codeplex and Facebook.NET followed both tutorials down to the word - But as soon as I browse to me app on Facebook I am getting the following error for BOTH versions?
API Error Code: 100
API Error Description: Invalid parameter
Error Message: Requires valid next URL.
Anyone else had this problem? I'm struggling to find an answer to what the error actually means? Especially as the starts kits are supposed to work out the box?

You need to disable data permissions.
Settings > Migrations > "New Data Permissions" > Disabled

Related

Getting 'couldn't send retry' error in web chat for questions which are not present in knowledge base

I created a bot with Azure in C#. This bot is working fine for question which are present in my knowledge base. But when I try different question, it gives error couldn't send retry below that question and reply to that question as Sorry, my bot code is having an issue.
It should reply No match found instead of Sorry, my bot code is having an issue.
One more issue is this bot sometimes gives random answer form KB for some questions which are not present in Kb instead of No answer found in KB.
In web chat channel, it shows following issue - There was an error sending this message to your bot: HTTP status code InternalServerError.
Any help will be appreciated.
First of all, regarding that tutorial:
This article uses Bot Framework v3 SDK. Please see this Bot Framework article, if you are interested in Bot Framework v4 SDK version of this information.
It's old and uses V3 of the Bot Framework SDK. I highly, highly recommend building any new bots in V4. Use the Add natural language understanding tutorial instead.
InternalServerError indicates that there's a problem with your bot code, somewhere.
Here's a few things you can try that are likely causing the issue:
Write code that deals with No Answer
The official QnAMaker Sample does that here:
// Query QnAMaker for Answer
var response = await qnaMaker.GetAnswersAsync(turnContext);
// If we have an answer, send it to the user
if (response != null && response.Length > 0)
{
await turnContext.SendActivityAsync(MessageFactory.Text(response[0].Answer), cancellationToken);
}
// If we don't have an answer, tell that to the user
else
{
await turnContext.SendActivityAsync(MessageFactory.Text("No QnA Maker answers were found."), cancellationToken);
}
Ensure your QnAMaker Service has a DefaultAnswer
This is likely only an issue if you set up your bot to get a default non-answer from your QnAMaker Service.
In Azure Portal > Resource Group > QnA App Service > Configuration (note: this is NOT your bot's app service; this one is specific to QnAMaker), ensure DefaultAnswer is set:
Debug
Assuming that your bot is actually breaking only when and because no QnA Answers were found, those two things should be the only thing you need to troubleshoot. Otherwise, here's how to debug a bot:
Visual Studio/C#:
In Visual Studio, run your bot by pressing F5 or clicking:
Open your bot in Emulator
In Visual Studio, go to Debug > Windows > Exception Settings:
In the Exception Settings window, full-check "Common Language Runtime Exceptions"
In Emulator, do the thing that makes your bot break. The bot should automatically stop when there's an error. Here, I've forced one:
As you can see, it says System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' This means that my array, response doesn't have a 0th element because no answers were returned.
Other issues will show other errors. You can usually pinpoint issues fairly easily by reading the error details and doing a web search for the error code if you need additional details.
VS Code
In VS Code, run your bot by pressing F5 and selecting 'Node.js' (for Node/TypeScript bots) or .NET Core (for C# bots):
Open your bot in Emulator
In VS Code, open the Debug menu:
Under "BREAKPOINTS", check "All Exceptions" (Note: It's important to run your bot before checking this box because there are normal exceptions that occur when the bot starts up):
In Emulator, do the thing that makes your bot break. The bot should automatically stop when there's an error. Here, I've forced one:
As you can see, it says Exception has occurred: TypeError TypeError: Cannot read property 'answer' of undefined This means that qnaResults[0] is undefined, or doesn't exist, which indicates that no answers were returned.
Other issues will show other errors. You can usually pinpoint issues fairly easily by reading the error details and doing a web search for the error code if you need additional details.

Twilio Line 30: var Twilio = new TwilioRestClient(

HI I have been trying to authenticate my new asp.net framework 4.5.2 [WEB FORMS] website with twilio for a while the website has nothing on it besides the codes I fallowed in the like while updating with my twilio credentials.
Ive fallowed these steps to a 'T' with the latest version of twilio and restsharp. and I have also tried with using an older package of twilio helper 3.6.23 and restSHarp 104.4.0
http://www.asp.net/web-forms/overview/security/create-an-aspnet-web-forms-app-with-sms-two-factor-authentication#SMS
But every time I try to add a number it prompts me to locate messages.cs which I don't have in that project
out of severe desperateness one time I eventually have even tried to make a replica one with my identity.config and I copy and pasted everything updated in there to my messages.cs file that I made. but still have the same outcome.
and the only difference that using the older version of twilio and restsharp gave me was to locate core.cs [& I'm not sure what that is] then I click cancel and it gives me this same error in visual studio. like it did all the other versions of twilio and restsharp .
An exception of type 'System.MissingMethodException' occurred in Twilio.Api.dll but was not handled in user code Additional information: Method not found: 'Void RestSharp.RestClient.set_BaseUrl(System.Uri)'.
and then it highlights these lines in my identitiyConfig.cs file
var Twilio = new TwilioRestClient(
ConfigurationManager.AppSettings["where I wrote my twilio sid"],
ConfigurationManager.AppSettings["where I wrote my twilio auth token"]
);
finally after I stop debugging I get this error in the browser I was debugging from
Method not found: 'Void RestSharp.RestClient.set_BaseUrl(System.Uri)'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Method not found: 'Void RestSharp.RestClient.set_BaseUrl(System.Uri)'.
Then this line is in RED
Line 30: var Twilio = new TwilioRestClient(
Any help will be soooo greatly appreciated or if theres another answer with this exact question that would be amazing as well thanks a ton.
also this in my first year of college in computer science at least so I'm not a programmer genius by any means[obviously lol] but I hope to become one I love to code

Marketplace windows phone beta test Error code: 805a0194

After adding the application in the Marketplace for beta testing, when I try to open a link in the application beta testers shows Error code: 805a0194. And none of the testers can download the application to test ... what to do? what is this error? After adding an application to the App Hub's been 2 days.
Windows error codes like that are fairly easy to reverse-engineer. The 8 makes it a fatal error. The 0x5a is the 'facility code', an indication what component caused the error. 90 is undocumented right now in WinError.h, probably means "Windows Phone". The last word is the error code.
0x194 = 404. The Universal Internet File-not-found Error Code. Something wrong with the url you use.
Beta submission takes 4 hours to complete – the app then becomes “published”. It takes another 8 hours before the app becomes available for download.

Mathematica .Net/Link in an Asp.Net application

I am using the Mathematica .Net/Link platform to create a web service to format and calculate math problems. However I am unable to get it working.
I create it using this code:
_Log.IpDebug("Starting the Kernel Link");
if (string.IsNullOrEmpty(_MathLinkArguments))
_InternelKernel = MathLinkFactory.CreateKernelLink();
else
_InternelKernel = MathLinkFactory.CreateKernelLink(_MathLinkArguments);
_Log.IpDebug("Kernel Link Started");
_InternelKernel.WaitAndDiscardAnswer();
The value of _MathLinkArguments is -linkmode launch -linkname \"C:\\Program Files\\Wolfram Research\\Mathematica\\7.0\\Math.exe\".
This piece of code is called from the Application_Start method of the global.asax.cs file.
When it gets to the WaitAndDiscardAnswer() call it gives the server error:
Error code: 11. Connected MathLink program has closed the link, but there might still be data underway.
Note: The SampleCode given with the .NET/Link package (both a console app and a WinForms app) works.
Edit:
I copied the console app sample code given with Mathematica into an asp.net page and it gave me the same error the first load and then on subsequent loads it gave me:
Error code: 1. MathLink connection was lost.
Edit2:
I forgot to mention that when I have procmon and task manager open while running my app, I can tell that Math.exe starts but it immediately exits, which makes those error code make complete sense...but doesn't explain why that happened.
To allow the .Net/Link to work in Asp.net (at least in IIS 7.5) you need to enable the property loadUserProfile on the app pool for the web site.
I am not entirely sure why this is the case, but from what I found while trying to debug this, there are some things that are gotten from the user's profile. I know for a fact that the default location of the kernel is, which explains why I couldn't use it with no arguments, and so I can only assume that other things are needed as well and without the profile it couldn't determine that.
But whatever the reason is this is required, it is, or at least it is a fix if you are getting similar problems like this in your own application.
I got the same error in a .Net WinForm application.
mathKernel = new MathKernel();
mathKernel.Compute("<< XYZ`XYZGraphs`");
The error occurred on loading the package straight after instantiating the MathKernel.
To resolve it you can wait a couple of seconds and then instantiating the MathKernel works fine. During this state where there might still be data underway the following conditions are both false:
if (!MathKernel.IsConnected)
{
MathKernel.Connect();
}
if (MathKernel.IsComputing)
{
MathKernel.Abort();
}
Edit:
I've recieved the error again and this time was able to determine the problem.
Using a command line open the MathKernel.exe and view the error message:

Accessing Google Spreadsheets with C# using Google Data API fails with Mono

I'm trying to access my Google spreadsheets using the GData API. I have followed the example which looks like:
var service = new SpreadsheetsService("myTest");
service.setUserCredentials(username, password);
var query = new SpreadsheetQuery();
var feed = service.Query(query);
This should return a feed with a list of spreadsheets. However this fails with:
Google.GData.Client.GDataRequestException: Execution of request failed: http://spreadsheets.google.com/feeds/spreadsheets/private/full ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
When I try the above link directly in my browser I'm able to download the feed, as long as I'm logged in into my Google account.
Some further information:
I'm not behind a firewall
I have checked my username (maurits.rijk at gmail.com) and password several times
I am using Mandriva in VirtualBox on a MacBook
All my code is compiled with Mono
I tried the same functionality in Java on OS-X. That code runs as expected.
Looks like a Mono problem to me.
Could you test with fiddler to test if your call reach the server?
I found the problem and solution on Google code, Issue 88 as comment 8.
In short, using
mozroots --import --sync --quiet
solves this problem. For me it now works.

Categories