首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到System.MissingMethodException Message=Method : DryIoc.Rules DryIoc.Rules.WithoutFastExpressionCompiler()

找不到System.MissingMethodException Message=Method : DryIoc.Rules DryIoc.Rules.WithoutFastExpressionCompiler()
EN

Stack Overflow用户
提问于 2022-05-16 10:38:24
回答 2查看 492关注 0票数 2

我使用的是Prism.DryIoc.Extensions(v8.0.62)和Prism.DryIoc.Forms(v8.1.97),这两个版本在我的Xamarin.Forms项目内部分别使用DryIoc.dll v4.7.3和v4.7.7。

我还为我的项目提供了一个nuget更新,它在内部使用DryIoc.dll v5.0.2。

现在,如果我将项目nuget更新为最新版本,它会引发错误。因为有版本冲突。

因为这是一个项目相关的nuget,我将不得不以某种方式更新。但是它依赖于棱镜,并且棱镜还没有发布任何最新版本的最新DryIoc.dll。

我试图在我们的.csproj文件中添加以下内容

代码语言:javascript
复制
<PackageReference Include="Prism.DryIoc.Extensions" Version="8.0.62">
        <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
        <dependentAssembly>
          <assemblyIdentity name="DryIoc.dll" culture="neutral" />
          <bindingRedirect oldVersion="4.7.3" newVersion="5.0.2" />
        </dependentAssembly>
    </PackageReference>

这解决了编译时错误,但开始抛出运行时错误,如下所示,

找不到System.MissingMethodException Message=Method : DryIoc.Rules DryIoc.Rules.WithoutFastExpressionCompiler()

我还尝试创建app.config并使用下面的代码片段,

代码语言:javascript
复制
<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="DryIoc" publicKeyToken="dfbf2bd50fcf7768" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.0.1.0" newVersion="5.0.2.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

但是,这也是失败与上述相同的错误。

摆脱棱镜是解决方案之一,但这是一个巨大的努力,因为整个项目是使用棱镜。

解决这个问题的最佳解决方案是什么?请在这方面帮助我。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-05-16 11:08:48

棱镜的开源,您可以修改部件以使用DryIoc 5并使用那些dlls。

这又不是你被迫使用nuget软件包,它们是为了帮助。如果他们妨碍了,就把他们赶走。

票数 2
EN

Stack Overflow用户

发布于 2022-05-17 06:48:33

Prism.DryIoc.Forms正在DryIocContainerExtension中使用DryIoc.dll。棱镜是一个开放源码,因此,我克隆了repo,将DryIoc.dll更新为5.0.2,并构建了它,发现WithoutFastExpressionCompiler已在DryIoc.dll最新版本中删除。因此,删除了方法并创建了一个dll,并开始在我的项目中使用。开始起作用了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72257891

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档