我有一个UWP 项目
当我想在发行版配置中构建这个解决方案时,我得到了以下错误
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在System.Nullable<string>?中生成?
更新8/12/2022:
正如我在https://github.com/BSVN/linphone-windows10/issues/18#issue-1335892790中所说的,我发现问题是从引用项目到BSN.Resa.Vns.Commons和在Linphone项目中的BSN.Resa.Mci.CallCenter.AgentApp.Data,但是我不知道为什么引用这些项目会在McgInerop__中生成System.Nullable<string>?
更新8/25/2022:
我发现我的问题来自最新的StackExchange.Redis包,我在https://github.com/StackExchange/StackExchange.Redis/issues/2212上创建了问题并描述了我的问题,所以https://github.com/tommcdon在https://github.com/StackExchange/StackExchange.Redis/issues/2212#issuecomment-1220221475中对这个问题进行了调查
发布于 2022-08-11 18:22:32
类型'string‘必须是非空值类型,才能将其用作泛型类型或方法'Nullable’中的参数'T‘。
尝试将传入的字符串定义更改为可空字段,如string?。
https://stackoverflow.com/questions/73323646
复制相似问题