You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

UWP编译互操作代码时为何生成System.Nullable<string>引发CS0453错误?

UWP Release构建生成Nullable<string>引发CS0453编译错误

我有一个UWP项目,在Release配置下构建解决方案时,出现以下编译错误:

obj\x64\Release\ilc\intermediate\BelledonneCommunications.Linphone.App.McgInterop\Data.g.cs(110561,148): error CS0453
: The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or meth
od 'Nullable<T>'
obj\x64\Release\ilc\intermediate\BelledonneCommunications.Linphone.App.McgInterop\Data.g.cs(110562,148): error CS0453
: The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or meth
od 'Nullable<T>'
obj\x64\Release\ilc\intermediate\BelledonneCommunications.Linphone.App.McgInterop\ImplTypes.g.cs(235776,50): error CS
0453: The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or
method 'Nullable<T>'
obj\x64\Release\ilc\intermediate\BelledonneCommunications.Linphone.App.McgInterop\ImplTypes.g.cs(235837,41): error CS
0453: The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or
method 'Nullable<T>'

我的问题是:UWP为何会在ImplTypes.g.cs中生成System.Nullable<string>?

2022年8月12日更新

我在GitHub Issue中记录了排查进展:发现问题源于当前Linphone项目引用了BSN.Resa.Vns.Commons和BSN.Resa.Mci.CallCenter.AgentApp.Data两个项目,但暂不清楚引用这两个项目会导致McgInterop生成Nullable<string>的原因。

2022年8月25日更新

已定位问题根源:来自最新版本的StackExchange.Redis包。我已在对应项目仓库中提交问题描述,相关维护人员已启动调查工作。

内容的提问来源于stack exchange,提问作者sorosh_sabz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 04:18:16