FreeSql icon indicating copy to clipboard operation
FreeSql copied to clipboard

NET8 AOT 发布updaste报错 The binary operator Equal is not defined ,System.Reflection.Runtime.Typelnfos.RuntimeArrayTypelnfo

Open h0730303779 opened this issue 1 year ago • 3 comments

第一次保存正常 , 再查询出来后update 就报错了

        public async Task<int> UpdateAsync(T entity)
        {
            _context.Set<T>().Update(entity);
            return await _context.SaveChangesAsync();
        }

查询 issues发现 https://www.cnblogs.com/FreeSql/p/17836000.html 搜到一样的问题 尝试过 image Roots.xml ps:帮助过我解决反射问题 但解决不了freesql问题 image 增加了

	<assembly fullname="FreeSql" preserve="All" />

但还是不行

正常运行是正常的 image AOT后 image

数据库版本

sqlite

安装的Nuget包

<PackageReference Include="FreeSql" Version="3.2.833" />
  <PackageReference Include="FreeSql.DbContext" Version="3.2.833" />
  <PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.833" />

.net framework/. net core? 及具体版本

net 8 freesql 3.2.833

以下 AvaloniaAppFreeSqlTest最小复现代码.zip 是源码

h0730303779 avatar Aug 10 '24 16:08 h0730303779

你得定位错误对战,需要自己了解更多,的剪裁知识。

不要把目光放在freesql上。

2881099 avatar Aug 10 '24 16:08 2881099

一旦用aot,尽量用更少的功能,减少剪裁成本,这里不建议使用 freesql.dbcontext。

2881099 avatar Aug 10 '24 16:08 2881099

一旦用aot,尽量用更少的功能,减少剪裁成本,这里不建议使用 freesql.dbcontext。

1723345947886

堆栈信息

我现在代码改成

                await fsql.Update<ConfigEntity>(configEntity2).ExecuteAffrowsAsync();

确实可以 aot了 谢谢 dbcontext后续支持AOT吗? EF用习惯了 有点改不过来

h0730303779 avatar Aug 11 '24 03:08 h0730303779