MVC3 EE CTP - Format of the initialization string does not conform to specification starting at index 0 - entity-framework

I have small MVC 3 Entity code first application, I created table in my local database and took the backup of table and restored the data on winhost web hosting database.
In my web.config I have change connection string to winhost connection starting. it wrosk on my desktop.
I transferred my local application to windows, when access the application I am getting this error.
error coming from this method.
public ActionResult ListRecords()
{
var query = from e in db.Envelopes
orderby e.ReportDate descending
select e;
IEnumerable<Envelopes> top10 = query.Take(25);
return View(top10.ToList<Envelopes>());
}
Error message:
Format of the initialization string does not conform to specification starting at index 0.
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.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
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:
[ArgumentException: Format of the initialization string does not conform to specification starting at index 0.]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +5025863
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +132
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +64
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +59
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name) +399
System.Data.Entity.Internal.LazyInternalConnection.Initialize() +49
System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel() +10
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +252
System.Data.Entity.Internal.InternalContext.Initialize() +16
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +16
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +61
System.Data.Entity.Internal.Linq.InternalSet`1.get_Provider() +15
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +13
System.Linq.Queryable.OrderByDescending(IQueryable`1 source, Expression`1 keySelector) +66
Envelopesonly.Controllers.HomeController.ListRecords() in HomeController.cs:84
lambda_method(Closure , ControllerBase , Object[] ) +40
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +188
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +56
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +267
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +190
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +329
System.Web.Mvc.Controller.ExecuteCore() +115
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +94
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +31
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +23
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +59
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841105
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Any help fixing this error?
Thanks
SR

Why are you still using the CTP? The release has been out for quite some time. Upgrade, then see if your problem persists. It may be a fixed problem.

The stack trace points out that there is a problem with your connection string.
Fix your connection string, and the problem should dissapear.

Related

Getting error in Entity Framework at SaveChanges

I'm getting this error:
An exception of type
'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException'
occurred in EntityFramework.dll but was not handled in user code
Additional information: Store update, insert, or delete statement
affected an unexpected number of rows (0). Entities may have been
modified or deleted since entities were loaded. Refresh
ObjectStateManager entries.
dbContext.Productos.Add(producto);
dbContext.Entry(producto).State = System.Data.Entity.EntityState.Modified;
dbContext.SaveChanges();
}
Any idea about what is wrong here?
Thanks.
My stack trace is:
[OptimisticConcurrencyException: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.]
System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.ValidateRowsAffected(Int64 rowsAffected, UpdateCommand source) +232
System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update() +493
System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.<Update>b__2(UpdateTranslator ut) +32
System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update(T noChangesResult, Func`2 updateFunction) +272
System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update() +143
System.Data.Entity.Core.Objects.ObjectContext.<SaveChangesToStore>b__35() +34
System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction(Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) +448
System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction) +219
System.Data.Entity.Core.Objects.<>c__DisplayClass2a.<SaveChangesInternal>b__27() +71
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +213
System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction) +408
System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options) +39
System.Data.Entity.Internal.InternalContext.SaveChanges() +320
[DbUpdateConcurrencyException: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.]
System.Data.Entity.Internal.InternalContext.SaveChanges() +366
System.Data.Entity.Internal.LazyInternalContext.SaveChanges() +56
System.Data.Entity.DbContext.SaveChanges() +52
Clase5.Data.ProductoRepositorio.Insertar(Producto producto) in c:\Users\Juan\Downloads\Clase_5_-_Codigo_fuente\Clase5\Clase4\Data\ProductoRepositorio.cs:27
Clase5.Controllers.ProductoController.TresCrearProducto(Producto producto) in c:\Users\Juan\Downloads\Clase_5_-_Codigo_fuente\Clase5\Clase4\Controllers\ProductoController.cs:43
lambda_method(Closure , ControllerBase , Object[] ) +180
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9657896
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
You have implemented a field level concurrency in Producto entity. Go to the EDMX designer of your Producto entity. Go through properties of each column one by one. Select the column in the visual entity designer -> Press F4. Check the value of the property Concurrency Mode. It should be set to None. Have a look at below snapshot as sample for one of my entities Employee. If for any of the columns, you see the value as Fixed then that's the root cause of your error.
If you are really thinking of doing field level concurrency then use RowVersion instead.
Have you set AutoDetectChangesEnabled to false? If you have done that,please call DetectChanges manually before SaveChanges, don't change the Entry State directly.

SSRS2008 Report SOAP OutOfMemoryException in IE8

I have an MVC3 website that uses SOAP to run a reporting services report and this is then returned to the browser. The users have IE8 on their machines and all the reports run fine except for one particular report that is throwing an error. The report takes 3 parameters and returns a table with < 10 rows. It only throws the error in IE8 when the number of rows is > 0. If the number of rows = 0 then it will return the report with just the headings. The report runs fine in ReportManager and FireFox. I have searched the web and StackOverflow looking for an answer with no success. The problem is I am not 100% sure whether it is a SOAP or SSRS problem or even something else and was hoping for some guidance.
IE8 Error
System.ServiceModel.FaultException: An internal error occurred on the report server. See the error log for more details. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.Exception: For more information about this error navigate to the report server on the local server machine, or enable remote errors
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Grj.Rail.Services.Reporting.ReportExecutionServiceSoap.LoadReport(LoadReportRequest request)
at Grj.Rail.Services.Reporting.ReportExecutionServiceSoapClient.LoadReport(TrustedUserHeader TrustedUserHeader, String Report, String HistoryID, ServerInfoHeader& ServerInfoHeader, ExecutionInfo& executionInfo) in C:\VS Projects\Grj\Source Code\Rail\Source\trunk\Grj.Rail.Services\Service References\Reporting\Reference.cs:line 3248
at Grj.Rail.Services.Impl.ReportService.InnerGetReport(String report, ParameterValue[] parameters, Byte[]& output, String& extension, String& mimeType, String& encoding, Warning[]& warnings, String[]& streamIds, String format) in C:\VS Projects\Grj\Source Code\Rail\Source\trunk\Grj.Rail.Services\Impl\ReportService.cs:line 86
at Grj.Rail.Services.Impl.ReportService.GetReport(String report, ReportTypes reportType, IDictionary`2 parameters) in C:\VS Projects\Grj\Source Code\Rail\Source\trunk\Grj.Rail.Services\Impl\ReportService.cs:line 72
at Grj.Rail.Services.Impl.ReportService.GetDayPlanReport(Int32 ticketOrderId, String dayPlanDate) in C:\VS Projects\Grj\Source Code\Rail\Source\trunk\Grj.Rail.Services\Impl\ReportService.cs:line 138
at Grj.Rail.Controllers.TicketOrderController.DayPlan(Int32 ticketOrderId) in C:\VS Projects\Grj\Source Code\Rail\Source\trunk\Grj.Rail\Controllers\TicketOrderController.cs:line 628
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
SSRS Error log
library!ReportServer_0-105!2268!06/25/2013-13:18:45:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: , Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
at System.Text.StringBuilder.Append(String value)
at System.IO.StringWriter.Write(String value)
at System.Xml.XmlTextEncoder.Write(String text)
at System.Xml.XmlTextWriter.WriteString(String text)
at Microsoft.ReportingServices.ReportProcessing.ParameterInfo.WriteValueToXml(XmlTextWriter xml, Object val)
at Microsoft.ReportingServices.ReportProcessing.ParameterInfo.WriteToXml(XmlTextWriter xml, Boolean writeTransientState)
at Microsoft.ReportingServices.ReportProcessing.ParameterInfoCollection.ToXml(Boolean usedInQueryValuesOnly, Boolean writeTransientState, Boolean convertToString)
at Microsoft.ReportingServices.ReportProcessing.ParameterInfoCollection.ToXml(Boolean usedInQueryValuesOnly)
at Microsoft.ReportingServices.Library.ReportItem.get_EffectiveParamsXml()
at Microsoft.ReportingServices.Library.DatabaseSessionStorage.AddNewSession(SessionReportItem sessionReport)
at Microsoft.ReportingServices.Library.CreateNewSessionAction.Save()
--- End of inner exception stack trace ---;
Web.Config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportExecutionServiceSoap" maxReceivedMessageSize="5242880">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://grj-report01:80/ReportServer/ReportExecution2005.asmx"
binding="basicHttpBinding"
bindingConfiguration="ReportExecutionServiceSoap"
contract="Reporting.ReportExecutionServiceSoap"
name="ReportExecutionServiceSoap" />
</client>
</system.serviceModel>
ReportService
using (var reportingServices = new Reporting.ReportExecutionServiceSoapClient("ReportExecutionServiceSoap"))
{
System.Net.NetworkCredential clientCredentials = new System.Net.NetworkCredential(railConfig.ReportingServicesUserName, railConfig.ReportingServicesPassword);
reportingServices.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
reportingServices.ClientCredentials.Windows.ClientCredential = clientCredentials;
reportingServices.ClientCredentials.Windows.AllowNtlm = true;
ServerInfoHeader serverInfoHeader;
ExecutionInfo executionInfo;
ExecutionHeader executionHeader = reportingServices.LoadReport(null, report, null, out serverInfoHeader, out executionInfo);
if (parameters != null && parameters.Any())
{
reportingServices.SetExecutionParameters(executionHeader, null, parameters, null, out executionInfo);
}
reportingServices.Render(executionHeader, null, format, null, out output, out extension, out mimeType, out encoding, out warnings, out streamIds);
}
I have fixed this issue now and the problem was the date format of one of the parameters. Once i sorted this out the report ran fine in IE. Not sure why it would work in Firefox with the wrong format.

MVC3 Web Project Error: "An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128"

I published my MVC3 web project to Azure. When I tried to authorize with fb, I get an error below.
Additional info:
callbackUrl = http://site.azurewebsites.net/Facebook/AddSocialAccount
аuthenticateUrl = https://graph.facebook.com/oauth/authorize?client_id=*&response_type=code&redirect_uri=http%3A%2F%2Fsite.azurewebsites.net%2FFacebook%2FAddSocialAccount&scope=publish_stream%2Cemail%2Cuser_birthday
so the app authorizes on fb, goes to AddSocialAccount action and fails int the string:
var profile = this.Provider.GetUserProfile(code);
where goes to:
protected override Task<AccessGrant> PostForAccessGrantAsync(string accessTokenUrl, NameValueCollection request)
{
return this.RestTemplate.PostForObjectAsync<NameValueCollection>(accessTokenUrl, request)
.ContinueWith<AccessGrant>(task =>
{
string expires = task.Result["expires"];
return new AccessGrant(task.Result["access_token"], null, null, expires != null ? new Nullable<int>(Int32.Parse(expires)) : null);
});
}
and string with error is
string expires = task.Result["expires"];
Error:
Server Error in '/' Application.
enter code here
An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128
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.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128
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:
[SocketException (0x271d): An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128]
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) +6462061
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +271
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) +2233126
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) +14
Spring.Http.Client.WebClientHttpRequest.ExecuteRequestCallback(IAsyncResult result) in f:\bamboo-home\xml-data\build-dir\SPRNETREST-RELEASE-JOB1\src\Spring.Rest\Http\Client\WebClientHttpRequest.cs:246
[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3548265
System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) +73
System.Threading.Tasks.Task`1.get_Result() +10486829
Project.Social.Facebook.Api.Impl.FacebookOAuth2Template.<PostForAccessGrantAsync>b__0(Task`1 task) in D:\Code\Poll\Project.Social\Facebook\Api\Impl\FacebookOAuth2Template.cs:23
System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() +81
System.Threading.Tasks.Task.Execute() +49
[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3548265
System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) +73
System.Threading.Tasks.Task`1.get_Result() +10486829
Project.Social.Base.OAuth2SocialProvider`4.SetAccessToken(String code) in D:\Code\Poll\Project.Social\Base\OAuth2SocialProvider.cs:49
Project.Social.Base.OAuth2SocialProvider`4.GetServiceClient(String oauth_verifier) in D:\Code\Poll\Project.Social\Base\OAuth2SocialProvider.cs:66
Project.Social.Facebook.FacebookProvider.GetUserProfile(String oauth_verifier) in D:\Code\Poll\Project.Social\Facebook\FacebookProvider.cs:26 Project.Areas.FrontEnd.Controllers.ControllersBase.OAuthControllerBase`3.AddSocialAccount(String code, String oauth_verifier) in D:\Code\Poll\Project\Areas\FrontEnd\Controllers\ControllersBase\OAuthControllerBase.cs:112
lambda_method(Closure , ControllerBase , Object[] ) +147
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +214
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +106
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
When I use local computer with connectionString of Azure I don't get this error(I change the domain and url on fb).
Thanks for any ideas!
I fixed this problem. There was the default proxy in my web.config.
<system.net>
<defaultProxy>
<proxy usesystemdefault="True" proxyaddress="http://10.10.0.1:3128" bypassonlocal="True" />
</defaultProxy>
I removed it. And authorization works correct.

NullReferenceException with EF6 on Mono 3.0.3

I am trying to migrate existing Entity Framework project to Mono and found a strange bug: when request being executed and EF loads model schema it throws under Mono despite that under .Net with EF6 Alpha 2 it works. An exception is following:
at System.Xml.XmlReader.CalcBufferSize(Stream input)
at System.Xml.XmlTextReaderImpl.InitStreamInput(Uri baseUri, String baseUriStr, Stream stream, Byte[] bytes, Int32 byteCount, Encoding encoding)
at System.Xml.XmlTextReaderImpl..ctor(String url, Stream input, XmlNameTable nt)
at System.Xml.XmlTextReader..ctor(Stream input)
at System.Xml.Schema.XmlSchema.Read(Stream stream, ValidationEventHandler validationEventHandler)
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.Schema.SomSchemaSetHelper.AddXmlSchemaToSet(XmlSchemaSet schemaSet, XmlSchemaResource schemaResource, HashSet`1 schemasAlreadyAdded)
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.Schema.SomSchemaSetHelper.AddXmlSchemaToSet(XmlSchemaSet schemaSet, XmlSchemaResource schemaResource, HashSet`1 schemasAlreadyAdded)
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.Schema.SomSchemaSetHelper.ComputeSchemaSet(SchemaDataModelOption dataModel)
at System.Data.Entity.Core.Common.Utils.Memoizer`2.<Evaluate>c__AnonStorey106.<>m__100()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Result.GetValue()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Evaluate(TArg arg)
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.Schema.SomSchemaSetHelper.GetSchemaSet(SchemaDataModelOption dataModel)
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.Schema.CreateXmlReaderSettings()
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.Schema.Parse(XmlReader sourceReader, String sourceLocation)
at System.Data.Entity.Core.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList`1& schemaCollection)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, Boolean throwOnError)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerManifestToken, Memoizer`2& cachedCTypeFunction)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.StoreMetadataEntry.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.StoreItemCollectionLoader.LoadItemCollection(StoreMetadataEntry entry)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadItemCollection[T](IItemCollectionLoader`1 itemCollectionLoader, T entry)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetOrCreateStoreAndMappingItemCollections(String cacheKey, MetadataArtifactLoader loader, EdmItemCollection edmItemCollection, Object& entryToken)
at System.Data.Entity.Core.EntityClient.EntityConnection.LoadStoreItemCollections(MetadataWorkspace workspace, DbConnection storeConnection, DbConnectionOptions connectionOptions, EdmItemCollection edmItemCollection, MetadataArtifactLoader artifactLoader)
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace()
at System.Data.Entity.Core.EntityClient.EntityConnection.InitializeMetadata(DbConnection newConnection, DbConnection originalConnection, Boolean closeOriginalConnectionOnFailure)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection()
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<GetEnumerator>m__2C3()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction`1>m__29A[TResult](IEnumerable`1 sequence)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression)
I guess it cannot load metadata or something like that, at least deapest lines looks like known behaviour of XmlDocument and XmlSchema when they do not check that input stream is null. I tried to use metadata files instead of embedded resources, but it did not help.
I will try to digg into sources, but it would be really helpful if someone already have idea what is going on.
You are running quite unusual configuration, EF compiled by Mono and System.XML from .NET Framework. This itself should work if System.XML can deal with the location of your schema but it's not common configuration.
I'd check how is the schema embedded into your assembly and whether is using same namespace.

RPXLib.dll throwing the exception The remote server returned an error: (500) Internal Server Error

I am trying to build the site login facility as single sign on. some how I come across to the site Janrain where I found the API's to do so. also I am trying this in my asp.net MVC application. so that I was following the steps given over here
I followed exact steps what are given, so I think no need to give code here. But In my action as:
public bool signin(string token)
{
// string token = token_url;
RPXLib.RPXService service = new RPXLib.RPXService(new RPXLib.RPXApiSettings("https://singlesignontest.rpxnow.com/api/v2/auth_info", "56fd9a76a5da4dffb9a437fe09564544b209c622"));
try
{
RPXLib.Data.RPXAuthenticationDetails userDetails = service.GetUserData(token); //*Exception here*
return true;
}
catch (RPXLib.Exceptions.RPXAuthenticationErrorException ex)
{
} return false;
}
I am getting exception at denoted line of code. I am getting token value properly. but could not proceed a head. Exception is :
The remote server returned an error: (500) Internal Server Error.
Stack Trace:
[WebException: The remote server returned an error: (500) Internal Server Error.]
System.Net.HttpWebRequest.GetResponse() +5313085
RPXLib.RPXApiWrapper.Call(String methodName, IDictionary`2 queryData) in D:\Development\Projects (3rd Party)\RpxLib\src\RPXLib\RPXApiWrapper.cs:50
RPXLib.RPXService.GetUserData(String authenticationDetailsIdentifier) in D:\Development\Projects (3rd Party)\RpxLib\src\RPXLib\RPXService.cs:156
SingleSignOn.Controllers.HomeController.signin(String token) in D:\ParallelMinds\Study Material\MVC\SingleSignOn\SingleSignOn\Controllers\HomeController.cs:37
lambda_method(ExecutionScope , ControllerBase , Object[] ) +140
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +52
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +314
System.Web.Mvc.Controller.ExecuteCore() +105
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +39
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +59
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +44
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8674318
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
and asks for to open RPXLibWraper.cs from path.
D:\Development\Projects (3rd Party)\RpxLib\src\RPXLib\RPXApiWrapper.cs
what I have to do ?
i acctually had the same issue now and solved it. I am using their helper c# class and the path /api/v2/ is hard coded there. So you cant have that path in th https://rpxnow.come/api/v2/ string also, which is a inparam to the new Rpx() call. So just send in the url without the /api/v2/ to the new Rpx() call. Solved it for me.
Good luck!