[英]Xamarin projects not inheriting from shared library correctly
I've started working with Xamarin Forms using the .NET Standard. 我已经开始使用.NET Standard处理Xamarin Forms。 When trying to use a dependency injection for platform specific code (in this case, different code for Android and iOS), the project can not find the interface from the base project.
当尝试对平台特定的代码(在这种情况下,Android和iOS使用不同的代码)使用依赖项注入时,项目无法从基础项目中找到接口。
I was following a guide with an example shown below 我正在按照以下示例显示指南
However Visual Studio does not find my interface from the base project in the Android / iOS projects. 但是,Visual Studio在Android / iOS项目的基础项目中找不到我的界面。
The namespace can not be found either. 找不到名称空间。 The only one it finds is ProblemCode.Android.
它找到的唯一一个是ProblemCode.Android。 How would I fix this issue?
我该如何解决这个问题?
I don't see a reference to the your shared project in the last image. 我没有在上一张图片中看到对您共享项目的引用。
However, i have noticed with .NetStandard , Xamarin gets confused sometimes, Though it can get confused at the best of times for no reason at all. 但是,我注意到使用.NetStandard时 , Xamarin有时会感到困惑,尽管它可能在最佳情况下毫无理由地变得混乱。
Usually when i have benign problem with Xamarin i try the following sets. 通常,当我对Xamarin有良性问题时,请尝试以下方法。
Note : I'm not sure this will help you in your case, but it was at least worth mentioning 注意 :我不确定这是否对您有帮助,但这至少值得一提
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.