Results 1 to 5 of 5

Thread: .net8 aot only 5mb ,without .net framework

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,725

    .net8 aot only 5mb ,without .net framework

    https://www.cnblogs.com/FreeSql/p/17836000.html

    Google translate it.
    Statically compiled.net console _ net 8.exe is only 5 megabytes in size Compiled, can it be run under win7? Ho Ho Ho

    When the earliest version was compiled, it took up about 100mb of hard disk.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,216

    Re: .net8 aot only 5mb ,without .net framework

    In order to answer your question, I would have to do a web search in order to see whether .NET 8 is supported on Windows 7. I would think that you're just as capable of doing the same web search. Given that Windows 7 has been out of support for some time, it's very possible that it's not. Microsoft may have taken a pragmatic approach but providing a .NET framework on an OS that is not getting security updates may be considered too risky. If it is supported, .NET 8 would have to be installed on that OS in order to run .NET apps that are not self-contained.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,725

    Re: .net8 aot only 5mb ,without .net framework

    I want to be able to run statically compiled.net programs on any computer that doesn't have a.net8 environment installed.

    Net Core 7 version of the ExDUIR. NET, support native AOT compilation, compiled programs can run in win7 and can not be decompiled.

    It should be supported by win7 system.
    This is similar to a VB6 CCr control collection.

    If vs 2013 can make the same gorgeous interface as apple's mac operating system, it will be perfect.

    https://gitee.com/miss2446/ExDUIR.NETCore


    https://gitee.com/miss2446/ExDUIR.NE...o_buttonex.png
    Attached Images Attached Images  
    Last edited by xiaoyao; Dec 8th, 2023 at 09:22 PM.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,725

    Re: .net8 aot only 5mb ,without .net framework

    。 In the latest.NET 7, Microsoft has introduced a new feature, AOT (Ahead of Time) compilation for WinForms.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,725

    Re: .net8 aot only 5mb ,without .net framework

    HOW TO USE [UnmanagedCallersOnlyAttribute] ON VB.NET??

    Hi Team,

    I got Issues when i call the unmanaged resources functions from c#.net core dll into vb.net core windows application and automatically stops the execution of program when hit that function

    Please below is my code

    Dll Unmanaged function

    using System;
    using System.IO;
    using System.Reflection;
    using System.Runtime.InteropServices;
    using System.Text;

    namespace TestLibrary1
    {
    public class Class1
    {
    [UnmanagedCallersOnlyAttribute]
    public static IntPtr AddNE(IntPtr a)
    {
    try
    {
    IntPtr add = a;

    return add;
    }
    catch (Exception ex)
    {
    Console.WriteLine("Exception: " + ex.Message);
    }
    return (IntPtr)0;
    }
    }
    }

    vb.netcore windows code below to call dll

    Imports System.Runtime.InteropServices
    Imports Google.Apis.Calendar.v3.Data

    Public Class Form1
    Private Const DllName As String = "TestLibrary1NE.dll"

    <DllImport(DllName)>
    Private Shared Function AddNE(ByVal a As IntPtr) As IntPtr
    End Function
    Private Sub btnSend_Click(sender As Object, e As EventArgs) Handles btnSend.Click
    Try
    Dim ptrAddress As IntPtr = Marshal.StringToHGlobalAnsi(txtAddress.Text.Trim())
    Dim ptrResponse As IntPtr = AddNE(ptrAddress)
    Dim strResponse As String = Marshal.PtrToStringAnsi(ptrResponse)
    MessageBox.Show(strResponse)

    Catch ex As EntryPointNotFoundException
    Console.WriteLine(e.ToString())
    End Try
    End
    End Sub
    End Class

    but here when hit the dll function from vb.netcore windows application,suddenly execution stops automatically

    may i know the what is the solution to fix this and how to find out the error here

    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width