This post seems to be here a few more than a few times but I have gone through all of those and adjusted the code to have the true DLL name but still get the Unable to load the specified metadata resource error.
Now what comes the interesting part, this code works on the machine it was developed on in VS but does not work on any other machines or live version. I am not sure if this has anything to do with it.
Here is the Connection String - (Sources/Pass have been replaced with *)
<add name="RMUplistEntities" connectionString="metadata=res://RM.Data/DataEntities.Model1.csdl|res://RM.Data/DataEntities.Model1.ssdl|res://RM.Data/DataEntities.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=*;initial catalog=RMUplist;user id=*;password=*;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
This is the stack trace
Exception stack trace:
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource.LoadResource () [0x00016] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource.CreateReader () [0x00000] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource.CreateReaders (System.Data.Entity.Core.Metadata.Edm.DataSpace spaceToGet) [0x0001c] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderComposite.CreateReaders (System.Data.Entity.Core.Metadata.Edm.DataSpace spaceToGet) [0x0001b] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadEdmItemCollection (System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoader loader) [0x00000] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Metadata.Edm.MetadataCache+<>c__DisplayClass5.<GetMetadataWorkspace>b__0 (System.String k) [0x0000d] in <000f54522ad145bf987b3043022f9799>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs:1035
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace (System.String cacheKey, System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoader artifactLoader) [0x0000d] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace (System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions effectiveConnectionOptions) [0x0001f] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace () [0x0000f] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection () [0x00014] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Objects.ObjectContext..ctor (System.Data.Entity.Core.EntityClient.EntityConnection connection, System.Boolean isConnectionConstructor, System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, System.Data.Entity.Core.Common.Internal.Materialization.Translator translator, System.Data.Entity.Core.Query.InternalTrees.ColumnMapFactory columnMapFactory) [0x000ea] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Core.Objects.ObjectContext..ctor (System.Data.Entity.Core.EntityClient.EntityConnection connection) [0x00000] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel () [0x00006] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel () [0x00006] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext () [0x0007c] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.InternalContext.Initialize () [0x00000] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType (System.Type entityType) [0x00000] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.Linq.InternalSet`1[TEntity].Initialize () [0x0000e] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Internal.Linq.InternalSet`1[TEntity].get_InternalContext () [0x00000] in <000f54522ad145bf987b3043022f9799>:0
at System.Data.Entity.Infrastructure.DbQuery`1[TResult].System.Linq.IQueryable.get_Provider () [0x00016] in <000f54522ad145bf987b3043022f9799>:0
at System.Linq.Queryable.Where[TSource] (System.Linq.IQueryable`1[T] source, System.Linq.Expressions.Expression`1[TDelegate] predicate) [0x0001c] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq.Queryable/src/System/Linq/Queryable.cs:39
at RM.UpList.Controllers.HomeController.DailyRotation (System.Nullable`1[T] date) [0x00099] in /*/RMUplist-master/RM.UpList/Controllers/HomeController.cs:109
at (wrapper dynamic-method) System.Object:lambda_method (System.Runtime.CompilerServices.Closure,System.Web.Mvc.ControllerBase,object[])
at System.Web.Mvc.ActionMethodDispatcher.Execute (System.Web.Mvc.ControllerBase controller, System.Object[] parameters) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc.ControllerContext controllerContext, System.Collections.Generic.IDictionary`2[TKey,TValue] parameters) [0x00072] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionDescriptor actionDescriptor, System.Collections.Generic.IDictionary`2[TKey,TValue] parameters) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker+ActionInvocation.InvokeSynchronousActionMethod () [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39 (System.IAsyncResult asyncResult, System.Web.Mvc.Async.AsyncControllerActionInvoker+ActionInvocation innerInvokeState) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at (wrapper delegate-invoke) System.Web.Mvc.Async.EndInvokeDelegate`2[System.Web.Mvc.Async.AsyncControllerActionInvoker+ActionInvocation,System.Web.Mvc.ActionResult]:invoke_TResult_IAsyncResult_TState (System.IAsyncResult,System.Web.Mvc.Async.AsyncControllerActionInvoker/ActionInvocation)
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`2[TResult,TState].CallEndDelegate (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1[TResult].End () [0x00029] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult] (System.IAsyncResult asyncResult, System.Object tag) [0x00007] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d () [0x00014] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters+<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f () [0x00086] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32 (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`1[TResult].CallEndDelegate (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1[TResult].End () [0x00029] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult] (System.IAsyncResult asyncResult, System.Object tag) [0x00007] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21+<>c__DisplayClass2b.<BeginInvokeAction>b__1c () [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21.<BeginInvokeAction>b__1e (System.IAsyncResult asyncResult) [0x00041] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`1[TResult].CallEndDelegate (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1[TResult].End () [0x00029] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult] (System.IAsyncResult asyncResult, System.Object tag) [0x00007] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d (System.IAsyncResult asyncResult, System.Web.Mvc.Controller+ExecuteCoreState innerState) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at (wrapper delegate-invoke) System.Web.Mvc.Async.EndInvokeVoidDelegate`1[System.Web.Mvc.Controller+ExecuteCoreState]:invoke_void_IAsyncResult_TState (System.IAsyncResult,System.Web.Mvc.Controller/ExecuteCoreState)
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1[TState].CallEndDelegate (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1[TResult].End () [0x00029] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult] (System.IAsyncResult asyncResult, System.Object tag) [0x00007] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End (System.IAsyncResult asyncResult, System.Object tag) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Controller.EndExecuteCore (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Controller.<BeginExecute>b__15 (System.IAsyncResult asyncResult, System.Web.Mvc.Controller controller) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1[TState].CallEndDelegate (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1[TResult].End () [0x00029] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult] (System.IAsyncResult asyncResult, System.Object tag) [0x00007] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End (System.IAsyncResult asyncResult, System.Object tag) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Controller.EndExecute (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5 (System.IAsyncResult asyncResult, System.Web.Mvc.MvcHandler+ProcessRequestState innerState) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at (wrapper delegate-invoke) System.Web.Mvc.Async.EndInvokeVoidDelegate`1[System.Web.Mvc.MvcHandler+ProcessRequestState]:invoke_void_IAsyncResult_TState (System.IAsyncResult,System.Web.Mvc.MvcHandler/ProcessRequestState)
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncVoid`1[TState].CallEndDelegate (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1[TResult].End () [0x00029] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult] (System.IAsyncResult asyncResult, System.Object tag) [0x00007] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.Async.AsyncResultWrapper.End (System.IAsyncResult asyncResult, System.Object tag) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.MvcHandler.EndProcessRequest (System.IAsyncResult asyncResult) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest (System.IAsyncResult result) [0x00000] in <cc73190bab9d435c831510ff295c572a>:0
at System.Web.HttpApplication.async_handler_complete_cb (System.IAsyncResult ar) [0x00015] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpApplication.cs:988
This error happens if you have the EDMX in one project and you are using it from another project and the later in not able to load the EDMX files.
Have you tried changing your conenctionstring to
connectionString="metadata=res://*/;
There are also a lot of other possible causes for this. You can google around. This post has a lot of possible solutions.
Related
After repeating visiting screen, I get next error:
System.ObjectDisposedException: Cannot access a disposed object. at
Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable
self) [0x00029] in <286213b9e14c442ba8d8d94cc9dbec8e>:0 07-03
11:29:51.230 I/MonoDroid(20631): at
Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod
(System.String encodedMember, Java.Interop.IJavaPeerable self,
Java.Interop.JniArgumentValue* parameters) [0x00000] in
<286213b9e14c442ba8d8d94cc9dbec8e>:0 07-03 11:29:51.230
I/MonoDroid(20631): at Android.Views.View.set_Enabled
(System.Boolean value) [0x00022] in
:0 07-03 11:29:51.230
I/MonoDroid(20631): at
MvvmCross.Platforms.Android.Binding.Target.MvxViewClickBinding.RefreshEnabledState
() [0x00022] in
C:\projects\mvvmcross\MvvmCross\Platforms\Android\Binding\Target\MvxViewClickBinding.cs:64
07-03 11:29:51.230 I/MonoDroid(20631): at
MvvmCross.Platforms.Android.Binding.Target.MvxViewClickBinding.OnCanExecuteChanged
(System.Object sender, System.EventArgs e) [0x00000] in
C:\projects\mvvmcross\MvvmCross\Platforms\Android\Binding\Target\MvxViewClickBinding.cs:69
07-03 11:29:51.230 I/MonoDroid(20631): at (wrapper
managed-to-native)
System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
07-03 11:29:51.230 I/MonoDroid(20631): at
System.Reflection.MonoMethod.Invoke (System.Object obj,
System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder
binder, System.Object[] parameters, System.Globalization.CultureInfo
culture) [0x0003b] in :0 07-03
11:29:51.230 I/MonoDroid(20631): --- End of inner exception stack
trace --- 07-03 11:29:51.230 I/MonoDroid(20631): at
System.Reflection.MonoMethod.Invoke (System.Object obj,
System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder
binder, System.Object[] parameters, System.Globalization.CultureInfo
culture) [0x00054] in :0 07-03
11:29:51.230 I/MonoDroid(20631): at
System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x00000] in
:0 07-03 11:29:51.230
I/MonoDroid(20631): at
MvvmCross.WeakSubscription.MvxWeakEventSubscription`2[TSource,TEventArgs].OnSourceEvent
(System.Object sender, TEventArgs e) [0x0000a] in
C:\projects\mvvmcross\MvvmCross\WeakSubscription\MvxWeakEventSubscription.cs:74
07-03 11:29:51.230 I/MonoDroid(20631): at
MvvmCross.Commands.MvxWeakCommandHelper.RaiseCanExecuteChanged
(System.Object sender) [0x00014] in
C:\projects\mvvmcross\MvvmCross\Commands\MvxCommand.cs:96 07-03
11:29:51.230 I/MonoDroid(20631): at
MvvmCross.Commands.MvxCommandBase.b__9_0 ()
[0x00000] in
C:\projects\mvvmcross\MvvmCross\Commands\MvxCommand.cs:135
Not sure, if this android or mvvmcross issue. Can I avoid invoking view in MvxViewClickBinding, if it disposed?
I guess you could write a static extension method for Java.Lang.Object like below:
public static class ObjectExtensions
{
public static bool IsDisposedOrNull(this Object objectValue)
{
return objectValue?.Handle == IntPtr.Zero;
}
}
Any suggestions?
Code:
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath("~/CrystalReports/P_Order.rpt"));
TableLogOnInfo logon = new TableLogOnInfo();
logon = rpt.Database.Tables[0].LogOnInfo;
logon.ConnectionInfo.ServerName = myServerName";
logon.ConnectionInfo.DatabaseName = "myDBname";
logon.ConnectionInfo.UserID = "myUserID";
logon.ConnectionInfo.Password = "myPassword";
rpt.Database.Tables[0].ApplyLogOnInfo(logon);
Stream stream = rpt.ExportToStream(ExportFormatType.PortableDocFormat);
return File(stream, "application/pdf");
Error:
Server Error in '/' Application.
The system cannot find the path specified.
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.Runtime.InteropServices.COMException: The system cannot find the path specified.
Source Error:
Line 102: rpt.Database.Tables[0].ApplyLogOnInfo(logon);
Line 103:
Line 104: Stream stream = rpt.ExportToStream(ExportFormatType.PortableDocFormat);
Line 105: return File(stream, "application/pdf");
Line 106:
Stack Trace:
[COMException (0x80004005): The system cannot find the path specified.
]
CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +1140
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +655
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) +111
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) +98
Procurement.Controllers.ReportsController.OrderReport(DateTime FromDate, DateTime ToDate, Int32 DepartmentId, Int32 SiteId, Boolean Delivered) in c:\Users\Abdalla\Documents\Visual Studio 2013\Projects\Procurement\Procurement\Controllers\ReportsController.cs:104
lambda_method(Closure , ControllerBase , Object[] ) +309
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31
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
I would try the following:
Hmmm. I use backslashes - not forward slashes.
In Visual Studio, make sure your crystal report's Build Action is set to "Content" and "Copy to Output Directory" is set to "Copy Always"
Troubleshoot this way:
.
string xxx = rpt.Load(Server.MapPath(#"~\CrystalReports\P_Order.rpt"));
//then log the value of 'xxx' somewhere, just to make sure the path is what you are expecting it to be
//then verify on the server that the folder and report do in fact exist at the location specified by 'xxx'
I have an app that works fine in Debug build and mostly works in Release, but I get the stack trace at the bottom of this question. The binding that seems to be failing is the enabled property of the button. I think this because if I take it out the other bindings work. Simplified viewmodel code and ui axml below as well. I've localised the relevant difference between the release and debug builds to the "Use Shared Runtime" build setting. With this selected it works. Without it fails. Unfortunately I can not package the build for distribution if this option is selected. Does anyone have any idea what is going on here?
VisualStudio 2012
Xamarin 3.5.58.0
ui axml snippet for the button that is causing issues
<Button
android:padding="2dip"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
local:MvxBind="Click SendConfigCommand; Enabled ButtonEnabledSendConfig; Text ButtonLabelSendConfig, Mode=OneTime; LongClick HelpCommand, CommandParameter=HelpContinueDevice" />
ViewModel snippet for the properties used by the button (simplified for debuggingbuoi)
public string ButtonLabelSendConfig
{
get{return "Next";}
}
public bool ButtonEnabledSendConfig
{
get { return false; }
}
public ICommand SendConfigCommand
{
get
{
return m_SendConfigCommand ?? (m_SendConfigCommand = new MvxCommand(() =>
{
//Intentionally left empty
}));
}
}
private MvxCommand m_SendConfigCommand;
from viewmodel base class
public MvxCommand<string> HelpCommand
{
get { return this._HelpCommand ?? (this._HelpCommand = new MvxCommand<string>(key =>
{
var prompter = Mvx.Resolve<IUserInteraction>();
prompter.Alert(Localised.ResourceManager.GetString(key), null, Localised.Help, Localised.OkayButton);
})); }
}
private MvxCommand<string> _HelpCommand;
Stack trace
MvxBind:Error:653.39 Exception thrown during the view binding NullReferenceException: Object reference not set to an instance of an object
09-16 13:21:45.456 I/MvxBind (29040): 653.39 Exception thrown during the view binding NullReferenceException: Object reference not set to an instance of an object
at Cirrious.CrossCore.ReflectionExtensions+<>c__DisplayClass7.<GetProperties>b__4 (System.Reflection.PropertyInfo p) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1F`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.First[PropertyInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.FirstOrDefault[PropertyInfo] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
at Cirrious.CrossCore.ReflectionExtensions.GetProperty (System.Type type, System.String name) [0x00000] in <filename unknown>:0
at Cirrious.M
09-16 13:21:45.456 I/MvxBind (29040): at Cirrious.CrossCore.ReflectionExtensions+<>c__DisplayClass7.<GetProperties>b__4 (System.Reflection.PropertyInfo p) [0x00000] in <filename unknown>:0
[0:] MvxBind:Error:653.39 Exception thrown during the view binding NullReferenceException: Object reference not set to an instance of an object
at Cirrious.CrossCore.ReflectionExtensions+<>c__DisplayClass7.<GetProperties>b__4 (System.Reflection.PropertyInfo p) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1F`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.First[PropertyInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.FirstOrDefault[PropertyInfo] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
at Cirrious.CrossCore.ReflectionExtensions.GetProperty (System.Type type, System.String name) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.Target.Construction.MvxTargetBindingFactoryRegistry.TryCreateReflectionBasedBinding (System.Object target, System.String targetName, IMvxTargetBinding& binding) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.Target.Construction.MvxTargetBindingFactoryRegistry.CreateBinding (System.Object target, System.String targetName) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding.CreateTargetBinding (System.Object target) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding..ctor (Cirrious.MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Binders.MvxFromTextBinder.BindSingle (Cirrious.MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Binders.MvxFromTextBinder+<>c__DisplayClass1.<Bind>b__0 (Cirrious.MvvmCross.Binding.Bindings.MvxBindingDescription description) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[Cirrious.MvvmCross.Binding.Bindings.MvxBindingDescription,Cirrious.MvvmCross.Binding.Bindings.IMvxUpdateableBinding].MoveNext () [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[Cirrious.MvvmCross.Binding.Bindings.IMvxUpdateableBinding].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[Cirrious.MvvmCross.Binding.Bindings.IMvxUpdateableBinding].AddRange (IEnumerable`1 collection) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Droid.Binders.MvxAndroidViewBinder.ApplyBindingsFromAttribute (Android.Views.View view, Android.Content.Res.TypedArray typedArray, Int32 attributeId) [0x00000] in <filename unknown>:0
vvmCross.Binding.Bindings.Target.Construction.MvxTargetBindingFactoryRegistry.TryCreateReflectionBasedBinding (System.Object target, System.String targetName, IMvxTargetBinding& binding) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.Target.Construction.MvxTargetBindingFactoryRegistry.CreateBinding (System.Object target, System.String targetName) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding.CreateTargetBinding (System.Object target) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding..ctor (Cirrious.MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Binders.MvxFromTextBinder.BindSingle (Cirrious.MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Binders.MvxFromTextBinder+<>c__DisplayClass1.<Bind>b__0 (Cirrious.MvvmCross.Binding.Bindings.MvxBindingDescription descr
09-16 13:21:45.456 I/MvxBind (29040): at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1F`1[System.Reflection.PropertyInfo].MoveNext () [0x00000] in <filename unknown>:0
iption) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[Cirrious.MvvmCross.Binding.Bindings.MvxBindingDescription,Cirrious.MvvmCross.Binding.Bindings.IMvxUpdateableBinding].MoveNext () [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[Cirrious.MvvmCross.Binding.Bindings.IMvxUpdateableBinding].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[Cirrious.MvvmCross.Binding.Bindings.IMvxUpdateableBinding].AddRange (IEnumerable`1 collection) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Droid.Binders.MvxAndroidViewBinder.ApplyBindingsFromAttribute (Android.Views.View view, Android.Content.Res.TypedArray typedArray, Int32 attributeId) [0x00000] in <filename unknown>:0
This is most likely due to the linker. MvvmCross uses reflection to perform databinding. Since the only reference to the Enabled property is in the layout file, the linker doesn't include that in the final assembly.
MvvmCross adds a file in your Android project named LinkerPleaseInclude.cs. You will need to add a reference to the property in there to ensure it gets linked in.
Something like this:
public void Include(Button button)
{
button.Click += (s,e) => button.Text = button.Text + "";
button.Enabled = !button.Enabled;
}
See also: mvvmcross binding on switch fails on release
I am trying to add a header and footer to an MvxListView by using my own custom MvxAdapter.
From an Activity, I can just add the adapter to the listview in the OnCreate() method, and it just works.
But if I try to do the same from the OnCreateView() in a Fragment I get a Java.Lang.RuntimeException with the following stack trace:
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod) [0x00000] in <filename unknown>:0
at Android.Widget.BaseAdapter.NotifyDataSetChanged () [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.NotifyDataSetChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.OnItemsSourceCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of managed exception stack trace ---
java.lang.NullPointerException
at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
Am I missing something here?
Thanks!
During an attempted refactoring of an MVC 4 application my code got in such a twist I restored the whole thing from Subversion. Now, however, when I run the code I get the following exception and can't figure out how to eliminate it.
Server Error in '/' Application.
--------------------------------------------------------------------------------
Operation could destabilize the runtime.
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.Security.VerificationException: Operation could destabilize the runtime.
Source Error:
Line 756: ViewBag.PageSize = pageSize;
Line 757: ViewBag.pageNumber = pageNumber;
Line 758: return View(offenders.ToPagedList(pageNumber, pageSize));
Line 759:
Line 760:
Source File: e:\KOOL_save\KOOLR\Controllers\KOOLRController.cs Line: 758
Stack Trace:
[VerificationException: Operation could destabilize the runtime.]
PagedList.PagedList`1..ctor(IQueryable`1 superset, Int32 pageNumber, Int32 pageSize) +0
PagedList.PagedListExtensions.ToPagedList(IQueryable`1 superset, Int32 pageNumber, Int32 pageSize) +100
KOOLR.Controllers.KOOLRController.AdvancedSearch(String sortOrder, String resetButton, String LastName, String FirstName, String MiddleName, Nullable`1 page) in e:\KOOL_save\KOOLR\Controllers\KOOLRController.cs:758
lambda_method(Closure , ControllerBase , Object[] ) +2013
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +59
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +435
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +60
System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +50
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +75
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +44
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +139
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +126
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +323
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +44
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +139
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +50
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +68
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +184
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +136
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +45
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Can you try installing the latest version of it? This happens after upgrading to .NET 4.5 and is resolved in the latest version of PagedList.