I use xamarin forms. I have problem with "Newtonsoft.Json.JsonConvert.DeserializeObject" NullReferenceException crash on Xamarin.UWP only in Release mode (in Debug work, but in Release not). I saw, that I can add System.Core;System.Runtime.Serialization to the Skip linking assemblies to fix it. In Android Project I found this menu, but in UWP project not. What can I do?
I have edited #Dmitrii Kurylev's comment as the answer. if other users who come cross this issue, please reference following reply.
Solution is simple do not use json converter when you use the following code .it give null reference exeption on UWP in release mode.
DeserializeObject<List<MyClass>>(content, new MyJsonConverter());
For right work you should use
DeserializeObject<List<MyClass>>(content)
And if you want to use converter you can use attribute [JsonConstructor] or JsonConverter(typeof(MyClass))] in MyClass description. It will work correctly.
Related
I have superficial knowledge on referencing libraries in projects. Usually most of the time a simple 'add reference' and then browsing to the appropriate path, just works. I am following an issue I will try to explain , and show all the approaches I tried to tackle it.
I am trying to use AutoIt. In their website it is stated that simply adding the .dll and using it, is enough to integrate their functionality in visual studio.
I am doing just that but for the moment I can not get my head around what is happening.
AutoItX is a public static class, as also the Run function is the same (public static). After adding the reference I can navigate to the appropriate .cs (if I control click on it for example). So the class AutoItX is not something unknown for the project. Moreover, the function Run indeed exists
however not inside the project itself. AutoItX also needs staff from (dont know if it is important):
The main error is that AutoItX doesnt exist in this context.
I have tried to register the dll, I have tried to add the com reference and remove it, I have tried to move the .cs files inside the project. None of those corrected the issue.
Any help would be valuable. If I missed something and you need extra info, I am willing to provide it. (Latest vs, latest autoit version, .net framework type of project).
Actually the above works.
For future reference.
The reason I did not try it first was, that they propose in their website to reference the autoItX.assembly.dll. This is probably deprecated and does NOT work anymore.
Second, if you have already referenced it , downloading this from NuGet WONT fix it.
Finally, the NuGet package does NOT work with .net CORE but ONLY with .net Framework project
I installed AutoItX.Dotnet 3.3.14.5, my test is no problem.
You can refer to my steps to create a new project to test it.
Right click References=>Manage NuGet Packages=>Browse=>AutoItX.Dotnet=>Install
Running result:
Hi fellow programmers,
I'm creating a ControlLibrary for future project's that uses the amazing MaterialDesignXaml library. In this ControlLib I use the MaterialDesignThemes.dll that contains several styled controls, resources and classes.
Now my problem is that I need to use the same dll's in the real application (sae sollution for now). If I want to use the mentioned control library in this project (as project reference) I always get this error:
Dll Error in Application Project
.
I understand the problem the compiler has with this, since It cannot check if two refrences (from seperate projects in the sollution) are the same dll. But how can I fix this?
The strange thing is that the designer complains like in the screenshot, but the application runs just fine...
I'm using TortoiseSVN for Version Management, maybe this has to do something with it?
Any idea's?
I am getting the following Error when building a project:
"Cannot embed interop type 'Microsoft.Office.Core.MsoXXX' found in both assembly 'c:\Windows\assembly\GAC_MSIL\office\14.0.0.0__71e9bce111e9429c\OFFICE.DLL' and 'c:\myProject\lib\OFFICE.DLL'. Consider setting the 'Embed Interop Types' property to false."
I am getting 130 of this errors, each with another Microsoft.Office.Core.MsoXXX like MsoLineDashStyle or MsoSyncStatusType.
Actually most References within the Project in Visual Studio hat set the property to TRUE. So I changed them all, especially OFFICE.dll, to FALSE.
The errors still occur.
After a restart of VS the property of embed interop ist still set to FALSE.
Another project within the same map uses exactly the same OFFICE.dll (also located at c:\myProject\lib\OFFICE.DLL) and also has the flag set to FALSE. Building this project does work quite fine.
The project is a little bit older and was not build for a long time.
Except for one unknown object there were no marked erros by VS. I would expect further compile errors because of this. I dont know whether this could be related to the embed-flag problem.
Any ideas what could be wrong or how to solve it?
Thanks in advance.
I got the answer by reallive:
The first of the both dlls from the error-message
(c:\Windows\assembly\GAC_MSIL\office\14.0.0.0__71e9bce111e9429c\OFFICE.DLL)
was in fact named as Windows.Microsoft.Office.Core
while the second reference
(c:\myProject\lib\OFFICE.DLL)
was named as OFFICE.DLL.
Both were existing side by side in the project. After deleting one of the two references within my project there isnt any problem any more.
Also I am able to compile and run the code with embed-flag = TRUE!
So the error message was missleading here.
Thanks for listening.
I'm writing a C# Gtk# application under Mono/MonoDevelop in Linux Mint 17. I have a ComboBox on a form with 3 items in it. I was able to place it and such fine however, I get an error in the designer code stating that the ComboBox doesn't contain a definition for 'NewText'. The Mono documentation at docs.go-mono.com says that this NewText method is how you add items, however, apparently mine doesn't have it.
My MonoDevelop version is 4.0.12
The projects target Gtk# version is 3.0
I have the following references and their versions referenced in the project
And finally, the designer code
//top of file declaration
private global::Gtk.ComboBox framestyle_Val;
//further down, this defines all the items
this.framestyle_Val = global::Gtk.ComboBox.NewText ();
this.framestyle_Val.AppendText (global::Mono.Unix.Catalog.GetString ("Single Sprite"));
this.framestyle_Val.AppendText (global::Mono.Unix.Catalog.GetString ("Left/Right Sprites"));
this.framestyle_Val.AppendText (global::Mono.Unix.Catalog.GetString ("Left/Right/Upside-Down Sprites"));
It's worth noting that apparently there's no AppendText definition/method either but I assume that'll be straightened out once we get this one straightened out.
Any ideas? I'm confused myself. Thanks in advanced,
Mike
I had the same problem. MonoDevelop seems to be unable to generate proper code to use with Gtk#3.
You may want to install Gtk#2, this will not override the GTK#3 installation, and target your project with this version to be able to use MonoDevelop's visual design abilities.
And maybe you will need to create the clean GTK#2 project once again.
If you have found a solution to use GTK3, please give me an idea.
I have a C# application that references a C# library, they are both in the same solution, and were added using the Add Reference/Project tab.
When I change something (Add/Remove a member) in a class in the library, the intellisence in the C# application doesn't get updated. Everything compiles find, but I don't see the new members that were recently added.
I've tried things like rebuild all but that didn't do it. The only fix I have for it right now is to remove the reference, and add it again. That updates the intellisense information.
Does anyone know how to fix this?
I know this is a very old question but it came up when I searched for having the exact same issue. I eventually resolved the problem by right clicking on the c# library and selecting clean then building the class library again. Now changes are updating intellisense normally.