69 questions
-4
votes
0
answers
52
views
Make COM Server (Widget provider) ready for AOT [closed]
I have couple of windows 11 widgets. Implemented with the sample provided by microsoft which isn't AOT compatible. I found this question / awnser which looks very useful
How to rewrite the Windows App ...
0
votes
0
answers
33
views
WPF app crashes on startup with XamlParseException when publishing PublishAot
I’m publishing a .NET WPF app with the following publish settings:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<...
3
votes
1
answer
161
views
C# Native AoT - How to get pointer to Managed class to pass as parameter to Com Object
I have implemented INetworkListManagerEvents interface to get network connectivity state changes as a C# class.
In my project, the INetworkListManagerEvents is code generated via CsWin32 source ...
2
votes
1
answer
232
views
.NET 9 UWP Project with NativeAOT: "Overriding System.Private.CoreLib.dll with a newer version is not supported" error during publish
I'm developing a UWP application using .NET 9 with NativeAOT. When I try to publish the project, I get the following error:
D:\Documents\.nuget\packages\microsoft.dotnet.ilcompiler\9.0.4\build\...
0
votes
0
answers
106
views
Is it possible to suppress IL warnings in a C# project for specific dlls when publishing AOT
Json and JsonSubTypes in a C# / .NET 9 project with AOT-publishing enabled. These 2 libs are not trimming/AOT ready yet, but I'm sure the types that involved in my project are all reserved and working ...
0
votes
1
answer
83
views
Access private property with internal type AOT save
i tried to resolve aot warnings in my .Net maui app. I have a mapping like this:
Microsoft.Maui.Handlers.TabbedViewHandler.Mapper.AppendToMapping("TabbedPageCenterLabels", (handler, view)...
0
votes
0
answers
46k
views
Why are [UnmanagedCallersOnly(EntryPoint = "XXX")] exported in .lib file as XXX@number, when using nativeaot ilc compile on windows x86 cross-compile
I have some code in c# that I export to the dll with [UnmanagedCallersOnly(EntryPoint = "XXX")]:
public class Symbol {
[UnmanagedCallersOnly(EntryPoint = "...
-1
votes
1
answer
104
views
How do I handle dependency projects whith .Net8 AOT Publish to AWS Lambda? MSB4018 error
How can i deploy my .Net 8 AOT AWS Lambda project when the project has a dependency?
aws-extensions-for-dotnet-cli discussions:
https://github.com/aws/aws-extensions-for-dotnet-cli/discussions/364
...
2
votes
1
answer
274
views
Calling library generated with .NET Native AOT causes segfault when called from Java on Linux
I have a .NET 9 project that gets published as a native AOT library for Windows and Linux. This library exports some methods, that are in turn called from Java via FFM from Windows or Linux again. In ...
0
votes
0
answers
609
views
How do I pre-compile an EF Core 9 model/queries spread across multiple projects?
I currently have an app using EF Core with the database functions spread across several projects:
Data Model project, containing all model objects that will be found in the database
DbContext project,...
1
vote
1
answer
223
views
How to rewrite the Windows App SDK WidgetProvider registration code using ComWrappers source generation?
For Windows App SDK apps, to provide Windows widgets, it's required to write some COM interop code according to the official documentation:
First, Implement a class factory that will instantiate ...
2
votes
0
answers
1k
views
C# / .NET 8 application optimize startup time
I have a .NET 8 / C# application that I've compiled using AOT and ReadyToRun (R2R) options to maximize startup speed. The application deals with opening a serial port, writing/reading data from it and ...
0
votes
0
answers
430
views
Is there a way to make Automapper work in AOT build/release?
We use automapper.data in our project and it works quite well. Now I am experimenting the idea of publishing our project in AOT mode, After adding these in our project file and run our code
<...
1
vote
1
answer
589
views
Why doesn't strongly typed Configuration work with AOT
I am trying to add configuration to my console app via appsettings.json with a connection settings object
public class ConnectionSettings
{
public string IP { get; set; } = string.Empty;
...
2
votes
1
answer
149
views
Why does ilc.exe not find a suitable system module?
I am trying to introduce the .NET NativeAOT ilc.exe compiler into the build process of my compiler. For this, I am currently calling it with the following arguments:
ilc in.dll -o out.exe
To get ...
2
votes
1
answer
4k
views
Use System.Text.Json converters with JsonTypeInfo for AOT
My .NET 8 application is AOT-compiled so it needs to use JsonTypeInfo and cannot use reflection-based serialisation. Now I also want to use the converter feature to store objects differently than in ...
3
votes
0
answers
386
views
F# discriminated unions simple use raises AOT and trimming warnings on publish
F#, .NET 8 console app with DUs generates AOT & trimming warnings even for simple usage.
I am creating an F#, .NET 8 (SDK 8.0.302) console app and publish as a single file with AOT, trimming. I ...
2
votes
2
answers
1k
views
What is the difference between the .NET Minimal API and .NET AOT and how does it relate to each other if they are?
I have searched on the Internet, and I couldn't find a concrete explanation regarding this.
I have used the Minimal API before, and when I am using the .NET AOT, the project source code seems ...
0
votes
0
answers
105
views
Operation is not supported in Roslyn (Scripting API) when published AOT
The goal is to create a simple test application that enables the loading of a script and accesses a predefined static class and outputs a value from this class to the console.
Version Used:
4.10.0-3....
0
votes
1
answer
690
views
Correct way to link lssl and lcrypto for a static lib
I'm trying to build a static .a lib in C that would sha256 encrypt a string. I will access the lib from a C# NativeAOT program.
Before adding the sha256 encryption code I used the following commands ...
0
votes
1
answer
235
views
.NET 8 delegate* unmanaged throws Fatal error
I try to call manually mapped AOT-compiled .NET dll.
When i create delegate to function pointer and call it, it throws exception "Fatal error. Invalid Program: attempted to call a ...
3
votes
1
answer
597
views
Project obfuscation along with Native AOT compilation
I'm developing a small project in C# with .NET 7 that ends up being compiled into C++ code using AOT compilation. When publishing a project, I would like to obfuscate the C# code and send the ...
5
votes
1
answer
3k
views
How to enable JsonStringEnumConverter for all enums in .NET AOT
It looks like JsonStringEnumConverter requires dynamic code and we should switch to JsonStringEnumConverter<T> in AOT.
[JsonConverter(typeof(JsonStringEnumConverter<MyEnum>))]
public enum ...
3
votes
1
answer
1k
views
How can I install the .NET Native AOT compiler (ilc) for command-line usage outside of dotnet?
I'm writing a bare-metal OS kernel in C#, and I would like to execute the .NET AOT compiler from the command line without using the dotnet command, also avoiding the use of a .csproj file.
On ...
2
votes
1
answer
779
views
Use a Blanket policy to serialize enums as strings with snake case
I'm moving some libraries to .NET 8 and I'm trying to use the new JsonNamingPolicy.SnakeCaseLower for enums (I have a custom converter that I currently use that uses reflection but I want to drop it).
...