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

393 views Asked by At

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.

enter image description here

I get this error:

enter image description here

1

There are 1 answers

0
Mr Qian On BEST ANSWER

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.

enter image description here

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.

enter image description here

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.