facebook loginbutton sdk in c# crashing application - windows-phone-8

I need a small help
I have created a small physioit app for windows phone 8.
I have added facebookclient loginbutton in my xaml file.
Now when there is no data connection in my phone and when I run the code, it gives me TargetInvocationException and my app crashes.
Here is the exception I am getting –
innerException
{Facebook.WebExceptionWrapper: The remote server returned an error: NotFound. --->
System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---}
System.Exception {Facebook.WebExceptionWrapper}
How can I catch this exception?
I am using the facebook sdk to create the loginbutton
Here is the code snippet
<facebookControls:LoginButton
x:Name="loginButton"
Grid.Row="2"
Margin="5"
HorizontalAlignment="Right"
FetchUserInfo="True"
ApplicationId="xxxxxx"
SessionStateChanged="OnFacebookSessionStateChanged"
UserInfoChanged="OnFacebookUserInfoChanged"
AuthenticationError="LoginButtonAuthenticationError" />
Can you please help me out.

You could use NetworkInterface to check whether data connection is available or not and then allow the login button to do its action.
Something like this..
if(System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
//Allow login button
else
//Message user - no internet connection

Related

SSRS report attachments failed to open

We have migrated our servers to Cloud (AWS). We are using SSRS 2008R2. We are facing an issue while opening few attachments in the reports ( not all the attachments ).
We get the following error :
Server Error in '/OpenAttachments' Application.
The remote Server returned an error: (404) Not Found.
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.Net.WebException: The remote server returned an error: (404) Not Found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote server returned an error: (404) Not Found.]
System.Net.HttpWebRequest.GetResponse() +8674060
WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\fdsfsdfsdfn\Documents\Visual Studio 2012\Projects\WebApplication1\WebApplication1\OpenAtt.aspx.vb:17
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
Most of the attachments are working fine. This is happening with only a few attachments.
Thanks in advance.
Surya

SQL Reporting Services, The request failed with HTTP status 404: Not Found

A .net application works at a server which SQL Server 2005 , now we relocate the application to the new server which is SQL Server 2008.
Below is the error when I try to get a report from application:
Server Error in '/Importal' Application.
The request failed with HTTP status 404: Not Found. 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.Net.WebException: The request failed with
HTTP status 404: Not Found.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The request failed with HTTP status 404: Not Found.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall) +431225
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) +204
Microsoft.SqlServer.ReportingServices2005.Execution.ReportExecutionService.LoadReport(String
Report, String HistoryID) +69
Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String
Report, String HistoryID) +67
[MissingEndpointException: The attempt to connect to the report server
failed. Check your connection information and that the report server
is a compatible version.]
Microsoft.SqlServer.ReportingServices2005.Execution.MissingEndpointException.ThrowIfEndpointMissing(WebException
e) +4027725
Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String
Report, String HistoryID) +107
Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo() +121
Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1
parameters) +67 ImportPerformanceKPI.btnList_Click(Object sender,
EventArgs e) +425
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1565
You will need to configure Reporting Services on your new SQL Server if it's not configured.
You've probably done that.
Inside the error, we have:
[MissingEndpointException: The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version. ]
Next make sure that your application is pointed at the new instance of SQL Server (it was looking for a 2005 instance). And then check that your application will work with SSRS 2008.

.net application with mysql db error

This application was working fine in an earlier server and when we ported it to a new server we are getting this issue. What could be the real issue behind this error ? kindly suggest
The error that we get is as follows :
Server Error in '/' Application.
Stream does not support writing.
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.NotSupportedException: Stream does not support writing.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%# Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[NotSupportedException: Stream does not support writing.]
System.IO.__Error.WriteNotSupported() +56
System.IO.BufferedStream.WriteByte(Byte value) +43
MySql.Data.MySqlClient.PacketWriter.FlushBuffer() +112
MySql.Data.MySqlClient.PacketWriter.Flush() +68
MySql.Data.MySqlClient.NativeDriver.Authenticate411() +140
MySql.Data.MySqlClient.NativeDriver.Authenticate() +68
MySql.Data.MySqlClient.NativeDriver.Reset() +45
MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +207
MySql.Data.MySqlClient.MySqlPool.GetConnection() +52
MySql.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionString settings) +228
MySql.Data.MySqlClient.MySqlConnection.Open() +152
RemoteDB.OpenRemoteDataConnection() +156
RemoteDB.RemoteRecordFound(String tblname, String fldname, String txt, String SCond) +14
admin_Default.btnLogin_Click(Object sender, EventArgs e) +97
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.5472; ASP.NET Version:2.0.50727.5456
Appreciate your kind help in resolving this issue. This application is built on mysql db and asp.net version used for this site is 2.0
regards
venkat

Meteor OAuth Exception while invoking method 'login'

While trying to login using the Meteor packages accounts-facebook and accounts-google, I'm getting an OAuth handler exception. Packages accounts-twitter appears to work fine and logs in perfectly. I haven't written any code, this is right out of the box using the accounts-ui package
The front end simply says "Internal Server Error" in red text, and the Meteor stack trace is the following:
Exception in oauth request handler [Error: failed]
Exception while invoking method 'login' Error: failed
at Request.Meteor.http.call [as _callback] (app/packages/http/httpcall_server.js:117:19)
at Request.init.self.callback (/usr/lib64/meteor/lib/node_modules/request/main.js:122:22)
at Request.EventEmitter.emit (events.js:96:17)
at Request.<anonymous> (/usr/lib64/meteor/lib/node_modules/request/main.js:654:16)
at Request.EventEmitter.emit (events.js:123:20)
at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/lib64/meteor/lib/node_modules/request/main.js:616:14)
at IncomingMessage.EventEmitter.emit (events.js:123:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
at CleartextStream.socketOnData (http.js:1366:20)
I'm running the Meteor app on my own infrastructure with a working domain name. Any idea what's going on?
I had the same issue, and it turned out my service was not configured correctly, specifically I had the wrong Facebook app secret. Go into your mongo shell and check your meteor_accounts_loginServiceConfiguration to ensure it's set up correctly.
Start up Meteor, then go into the mongo shell via meteor mongo
Then type 'db.meteor_accounts_loginServiceConfiguration.find()' to show the documents in that collection. Now check your Facebook document to ensure it matches the app you created on Facebook exactly.
I did this and everything worked immediately.
Sorry for that. Our error reporting in these cases sucked. A fix is coming out in the soon-to-be-released Meteor 0.6.2.

Show code line number of Reporting Service Log

I am trying add custom HttpModule MyHttpModuler to Reporting service. But when i deployed my custom HttpModule to SSRS located in remote machine. then browser some report in the report manage site. I got some error in my page . I used to check the log file under the SSRS log folder to find out what happened. and I always find some exception info logged in it. But the exception log don't show the code line number .
The example of log could be like below.
library!ReportServer_0-1!728!08/22/2012-13:36:29:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details., ;
Info: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at HandlerLib.MyHttpModuler.TryAuthenticate(HttpApplication context)
at HandlerLib.MyHttpModuler.Application_BeginRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Is there any way to show the code line of exception log so that I can know more detail of my codes flaw? thanks