maybe someone know my problem,
i can't open axml file on android project
enter image description here
System.ArgumentNullException: Value cannot be null.
Parameter name: o
at System.Runtime.InteropServices.Marshal.GetIUnknownForObjectNative(Object o, Boolean onlyInContext)
at Xamarin.AndroidDesigner.Windows.WindowsAndroidSurfaceRenderer.UpdateD3DImageFromSharedSurface() in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner.Windows\WindowsAndroidSurfaceRenderer.cs:line 140
at Xamarin.AndroidDesigner.Windows.WindowsAndroidSurfaceRenderer.RenderDesignerItemVisual(DesignerItem item) in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner.Windows\WindowsAndroidSurfaceRenderer.cs:line 131
at Xamarin.Designer.Windows.WpfSurfaceRenderer.QueueRender(DesignerItem item) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 361
at Xamarin.AndroidDesigner.AndroidDesignerSurface.HandleSessionImageChanged(Object sender, EventArgs e) in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner\AndroidDesignerSurface.cs:line 229
at Xamarin.AndroidDesigner.AndroidDesignerSession.OnImageChanged() in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner\AndroidDesignerSession.cs:line 2321
at Xamarin.AndroidDesigner.AndroidDesignerSession.HandleRendered(Object sender, EventArgs e) in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner\AndroidDesignerSession.cs:line 1381
visual studio 2017 Version 15.5.7
xamarin 4.8.0.760
xamarin.android SDK 8.1.5.0
Related
I'm using Azure Functions V3 (.Net Core 3.1) and trying to call an Entity FrameWork class built using EF 6.4 (.Net 7.2) and Entity Framework is throwing a NullReferenceException. The same call succeeds while using .Net Core console app instead of Azure Function. Appreciate your help here.
Here is my function definition:
namespace FunctionAppV32
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 * * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
var cstr = ConnectionString2.BuildConnectionString();
FlighterSIEntities entities = new FlighterSIEntities(cstr);
foreach (var x in entities.TGBotComplexVectorParamSettings)
{ .... }
}
}
}
The exception is thrown while accessing entities.TGBotComplexVectorParamSettings in for loop.
Exception Stack Trace:
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=EntityFramework StackTrace:
at System.Data.Entity.Core.EntityClient.EntityConnection.GetStoreConnection(DbProviderFactory factory)
at System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.Entity.Core.EntityClient.EntityConnection..ctor(String connectionString) at System.Data.Entity.Internal.LazyInternalConnection.Initialize() at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.Initialize() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet1.GetEnumerator() at System.Data.Entity.Infrastructure.DbQuery1.System.Collections.Generic.IEnumerable.GetEnumerator()
at FunctionAppV32.Function1.Run(TimerInfo myTimer, ILogger log) in D:\src\RnR-ExperimentationTools\src\TGBot\FunctionAppV32\Function1.cs:line 20
at Microsoft.Azure.WebJobs.Host.Executors.VoidMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\VoidMethodInvoker.cs:line 20 at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.d__10.MoveNext() in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionInvoker.cs:line 52
I was able to resolve exactly same issue with updating below packages to mentioned versions. Hope it helps to you or anyone facing the same issue.
EntityFramework to Version=6.4.4
Microsoft.EntityFrameworkCore to Version=3.1.6
Microsoft.Extensions.Configuration to Version=3.1.6
Kindly check.
I am trying to migrate a Team Project from TFS 2015 to Visual Studio Team Services. I connected to both the Source and Destination, selected the Team Project, mapped my users, and then when validating the Migration Summary a NullReferenceException is thrown.
The following was found in the OVSMU.log file:
2016-07-29 10:33:20,674 [1] ERROR Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at TFSMigrationUI.ViewModel.MigrationSummeryViewModel.worker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) in c:\Project_CheckOut\TFSMigration\TFSMigrationUI\ViewModel\MigrationSummeryViewModel.cs:line 1096
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Has anyone seen a similar problem?
I have recently tested the CachingStrategy for a ListView in a Xamarin Forms App with 1000 items in the list. List items are being created from a data template of ViewCell. I Tried using RecycleElement option for CachingStrategy.
When I did profiling, using Xamarin Profiler, for Android App deployed on Xamarin Anroid Player (emulator) I noticed that when I scroll through the list the memory allocation doesn't increase (on allocations summary tab). But, when I did profiling for iPhone App on emulator, I noticed that no data is being displayed on Allocations Summary tab. So I captured some snapshots while scrolling through the list and noticed whenever I scroll through the list (up or down), the memory allocation keeps increasing.
Why RecycleElement is not working for iOS (iPhone)?
I am using Mac for development.
Here are my tools:
=== Xamarin Studio ===
Version 5.10.1 (build 3)
Installation UUID: 7ae992a3-b710-4297-ba1d-0c519fbb2ea8
Runtime:
Mono 4.2.1 (explicit/6dd2d0d)
GTK+ 2.24.23 (Raleigh theme)
Package version: 402010102
=== Xamarin.Profiler ===
Version: 0.24.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Apple Developer Tools ===
Xcode 7.1.1 (9081)
Build 7B1005
=== Xamarin.iOS ===
Version: 9.2.1.54 (Enterprise Edition)
Hash: eb4c1ef
Branch: master
Build date: 2015-12-01 02:12:30-0500
=== Xamarin.Android ===
Version: 6.0.0.34 (Enterprise Edition)
Android SDK: /Users/haider/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.0.3 (API level 15)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1 rc1
SDK Build Tools Version: 23.0.2
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
=== Xamarin Android Player ===
Version: 0.6.5
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 2.4.0.109 (Starter Edition)
=== Build Information ===
Release ID: 510010003
Git revision: f2021a209d66d49cbc0649a6d968b29040e57807
Build date: 2015-12-01 10:43:40-05
Xamarin addins: dfd4f5103e8951edbc8ac24480b53b53c55e04ff
Build lane: monodevelop-lion-cycle6-baseline
=== Operating System ===
Mac OS X 10.11.1
Darwin Haiders-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0
Sat Sep 19 15:53:46 PDT 2015
root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Here's A Few Things To Check
In the Xamarin Profiler, ensure that you are only looking for the custom ViewCell class, and take multiple snapshots to trigger the garbage collector. It may be something else that is causing the memory leak if the number of ViewCells is not increasing. If the number of ViewCells is increasing, move on to suggestions 2 & 3, below. Xamarin Profiler ViewCell example
In the ViewCell code, make sure to override OnBindingContextChanged() and set the controls' properties in OnBindingContextChanged(), rather than in the ViewCell's constructor. I added some sample code below that shows how to implement the ListViewCachingStrategy.RecycleElement strategy using a custom ViewCell.
If you are subscribing an Event Handler for the ViewCell (to add a Context Action for example), make sure to subscribe the Event Handler in the OnAppearing() method of the ViewCell class and unsubscribe the Event Handler in the OnDisappearing() method of the ViewCell class. I've included a comment in the example ViewCell code below.
ListView Using RecycleElement
ListView = new ListView(ListViewCachingStrategy.RecycleElement)
{
DataTemplate(typeof(CustomViewCell))
};
ViewCell
public class CustomViewCell : ViewCell
{
Label _myLabel;
MenuItem _deleteAction;
public CustomViewCell()
{
_myLabel = new Label();
View = _myLabel;
}
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
_myLabel.Text = "";
var item = BindingContext as MyModel;
if (item != null)
{
_myLabel.Text = item.Text;
}
}
protected override void OnAppearing()
{
base.OnAppearing();
//Subscribe ViewCell Event Handlers
_deleteAction.Clicked += HandleDeleteClicked;
ContextActions.Add(_deleteAction);
}
protected override void OnDisappearing()
{
base.OnDisappearing();
//Unsubscribe ViewCell Event Handlers
_deleteAction.Clicked -= HandleDeleteClicked;
ContextActions.Remove(_deleteAction);
}
void HandleDeleteClicked(object sender, EventArgs e)
{
//Code to handle when the delete action is tapped
}
}
ViewCell Model
public class MyModel
{
[PrimaryKey]
public int ID { get; set; }
public string Text { get; set; }
}
I had working code on VS 2013 NET4.5. After update (VS 2013, NET 4.5.1) of NuGet packages I got this error
An exception of type 'System.InvalidOperationException' occurred in
System.Web.Mvc.dll but was not handled in user code
Additional information: The given filter instance must implement one
or more of the following filter interfaces: IAuthorizationFilter,
IActionFilter, IResultFilter, IExceptionFilter.
I am sure that I implemented IActionFilter interface, so how can I get error like this and how can I fix it?
FYI:
public class WWWActionFilterAttribute : System.Web.Mvc.ActionFilterAttribute, System.Web.Mvc.IActionFilter
{
public override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
{
System.Uri Address = filterContext.HttpContext.Request.Url;
string[] domains = Address.Host.Split('.');
if (domains.Length == 2)
{
System.UriBuilder AddressBuilder = new System.UriBuilder(Address);
AddressBuilder.Host = string.Format("www.{0}", AddressBuilder.Host);
filterContext.HttpContext.Response.Redirect(AddressBuilder.Uri.AbsoluteUri);
}
else
{
base.OnActionExecuting(filterContext);
}
}
}
Config
public class FilterConfig
{
public static void RegisterGlobalFilters(System.Web.Mvc.GlobalFilterCollection filters)
{
filters.Add(new System.Web.Mvc.HandleErrorAttribute());
filters.Add(new TIKSN.HomeWebsite.Generalization.WWWActionFilterAttribute());
filters.Add(new TIKSN.HomeWebsite.Globalization.LanguageActionFilterAttribute());
}
}
Are we talking about System.Web.Mvc.dll having to have the save version and if so where? If I add this DLL to my domain I can only get up to version 4.0. However I have a version 5.1 in my web API the project with web config file. I really don't understand why I would have to match these versions and why my solution doesn't recognize the highest version if that is why its failing. I believe Visual Studio 2013 Express automatically loaded version 5.1, but I had to get my own for the domain project and that doesn't offer 5.1. One of the worst things about MVC is dependency management.
You are adding a HttpFilter (WebAPI filter) to an MVC Global filter. Your filter should be added to HttpFilterCollection
Add this to filterConfig.cs
public static void RegisterHttpFilters(HttpFilterCollection filters)
{
filters.Add(new WWWActionFilterAttribute());
}
And this to Global.ascx.cs:
FilterConfig.RegisterHttpFilters(GlobalConfiguration.Configuration.Filters);
This was because of web.config file. You have to specify exact version of packages there. Look here
Update
In Web.config all packages are registered and have their name and version pairs. The actual versions and the versions in the Web.config were not matching.
I have a silverlight project that works perfectly when I run it independently (i.e. run instance), but when I run it from my MVC website it rises an exception that says
Unhandled Error in Silverlight 2 Application
Object reference not set to an instance of an object.
at TakingMyPicture.MainPage..ctor()
at TakingMyPicture.App.Application_Startup(Object sender, StartupEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)