Why is TinyIoC not picked up in my Xamarin.Android project when added using nuget?

拥有回忆 提交于 2021-01-29 08:35:56

问题


So I installed TinyIoC v1.3.0 using nuget in my Xamarin.Android project, its in the references, but I cannot type using TinyIoC; without a compile error. I would like to understand why this is?

PS. I know I can use the TinyIoC.cs file directly, but I thought it would be more convenient to update if I added using nuget.

I get this error:


回答1:


I think the issue is related to the nuget package TinyIoC 1.3.0 itself.

The nuget package does not contain the lib folder with the related dll so that you can not use the format by using namespace.

Note: Important

The nuget package contains a folder called Content. This folder will copy its content into the main project with packages.config when you install the nuget pacakge. See this similar issue on so.

And it will make TinyloC.cs file directly in your main project and you can just modify it there.

I have created a net framework project with packages.config format.

However, since your project is xamarin andorid app, it uses PackageReference nuget manage format, and content folder does not work for it. Instead, you should use ContentFiles folder, but this nuget package does not contain it.

To make this issue more clearly, you should contact the author of the nuget package to report this problem.



来源:https://stackoverflow.com/questions/64146987/why-is-tinyioc-not-picked-up-in-my-xamarin-android-project-when-added-using-nuge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!