.net-native

Why does .NET Native compile loop in reverse order?

廉价感情. 提交于 2020-07-06 11:15:27
问题 I'm working on optimization techniques performed by the .NET Native compiler. I've created a sample loop: for (int i = 0; i < 100; i++) { Function(); } And I've compiled it with Native. Then I disassembled the result .dll file with machine code inside in IDA. As the result, I have: (I've removed a few unnecessary lines, so don't worry that address lines are inconsistent) I understand that add esi, 0FFFFFFFFh means really subtract one from esi and alter Zero Flag if needed , so we can jump to

Why does .NET Native compile loop in reverse order?

北城以北 提交于 2020-07-06 11:15:26
问题 I'm working on optimization techniques performed by the .NET Native compiler. I've created a sample loop: for (int i = 0; i < 100; i++) { Function(); } And I've compiled it with Native. Then I disassembled the result .dll file with machine code inside in IDA. As the result, I have: (I've removed a few unnecessary lines, so don't worry that address lines are inconsistent) I understand that add esi, 0FFFFFFFFh means really subtract one from esi and alter Zero Flag if needed , so we can jump to

Building with .NET Native tool chain causes error with missing property in dynamic object

巧了我就是萌 提交于 2020-01-15 03:59:35
问题 I have a piece of code that gets a JSON response and checks whether there is a .error field dynamic jsonResponse = JsonConvert.DeserializeObject(responseString); if (jsonResponse.error != null) { error = jsonResponse.error; } else { success = true; } This runs successfully when it is not compiled with .NET Native toolchain but produces an error (on jsonResponse.error) when it's built with it. What is the reason for this? Any other similar incompatible behavior with native code? EDIT: It turns

Behavior SDK - ChangePropertyAction generates argument exception in runtime when compiling with .net native

岁酱吖の 提交于 2019-12-24 13:50:11
问题 I'm using DataTrigerBehavior from Behaviors SDK to change System.Windows.Shapes.Path.Data property according to the value of other propery, this is a part of my code: <Path x:Name="ItemPath" Stretch="Uniform" Grid.Column="0" Fill="#FF646464" Stroke="{x:Null}" StrokeThickness="3"> <Interactivity:Interaction.Behaviors> <Core:DataTriggerBehavior Binding="{Binding FType, Converter={StaticResource EnumToStringConverter}}" Value="Parent"> <Core:ChangePropertyAction TargetObject="{Binding

How to properly include an rd.xml file in a NuGet package?

孤者浪人 提交于 2019-12-24 07:09:45
问题 I'm developing a library that makes heavy use of reflection, and targets both .NET Core ( netstandard1.3 ) and full .NET ( net451 ). To make it work with .NET Native (i.e. UWP Release builds), it needs an rd.xml file, which looks like this: <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> <Library Name="MyLibrary"> <!-- bunch of directives here --> </Library> </Directives> I know these directives work because inserting them into the Application.rd.xml file of an UWP

Avoid .NET Native bugs

泪湿孤枕 提交于 2019-12-22 10:57:19
问题 I spent the last year (part time) to migrate my existing (and successful) Windows 8.1 app to Windows 10 UWP. Now, just before releasing it to the store, I tested the app in the "Release" build mode (which triggers .NET Native). Everything seemed to work until I - by chance - noted a subtle but serious (because data-compromising) bug. It took me two days to reduce it to these three lines of code: var array1 = new int[1, 1]; var array2 = (int[,])array1.Clone(); array2[0, 0] = 666; if (array1[0,

UWP App Package created with Visual Studio 2015 Update 3 won't install on phone

主宰稳场 提交于 2019-12-20 04:10:05
问题 Release mode appxbundle file created with Visual Studio 2015 Update 3 won't install on windows phone. This was working in Update 2. Installed field medic on phone and eventually found the error: Windows cannot install package 5207311c-9598-4622-9d3d-ff43d5fceb38 because this package depends on another package that could not be found. This package requires minimum version 1.4.24201.0 of framework Microsoft.NET.Native.Runtime.1.4 published by CN=Microsoft Corporation, O=Microsoft Corporation, L

Does UWP's .Net Native together with asynchronous programming make obfuscation irrelevant? [closed]

空扰寡人 提交于 2019-12-12 08:19:08
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I've read this blog (and readers' comments therein) with interest and it highlights UWP's binary compilation -- intended to boost performance -- but at the same time playing part in making reverse engineering difficult due to binary compilation. On making reverse engineering

MissingMetadataException when building UWP app with .Net native

你说的曾经没有我的故事 提交于 2019-12-11 23:27:50
问题 I have this UWP app that uses a project (UWP class library) which itself uses EF7 and SQLite. I tried to build the app in the Release mode using .Net native tool chain, the build completes successfully (after a good long time, and after eating as much memory as it can), but the application crashes just after leaving the splash screen. After following some advice on SO I tried the .Net native with Debug mode, the build finishes just like in the Release mode, but I get many errors on the output