Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
h0730303779 opened this issue Aug 10, 2024 · 3 comments

Comments

@h0730303779
Copy link

h0730303779 commented Aug 10, 2024

第一次保存正常 , 再查询出来后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
是源码

@2881099
Copy link
Collaborator

2881099 commented Aug 10, 2024

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

不要把目光放在freesql上。

@2881099
Copy link
Collaborator

2881099 commented Aug 10, 2024

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

@h0730303779
Copy link
Author

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

1723345947886

堆栈信息

我现在代码改成

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants