zauberzeug / SimpleStorage

Simple platform independent key/value storage
Other
35 stars 12 forks source link

.Net Standard #9

Open MaxThom opened 4 years ago

MaxThom commented 4 years ago

Hi,

I'm looking to use your plugin and I cant get my project to start. I get this error :

Severity    Code    Description Project File    Line    Suppression State
Error       Can not resolve reference: `PerpetualEngine.SimpleStorage.Desktop`, referenced by `LightYourHearth`. Please add a NuGet package or assembly reference for `PerpetualEngine.SimpleStorage.Desktop`, or remove the reference to `LightYourHearth`.    LightYourHearth.Android         

I added the nuget in my shared library and in the Android project. I also added the required line in the MainActivity.. Is is because of .NetFramework vs Standard ?

Ty If you have a solution or fix.

rodja commented 4 years ago

The package must be added to any project which uses the SimpleStorage lib. It looks like the build error happens in your NUnit testing project. Have you added the lib there?

MaxThom commented 4 years ago

I dont have any NUnit project. I added the library to the shared library and the android.

Silver7899 commented 4 years ago

Same problem. Package installed in all projects. 1

Using code in shared project App.xaml.cs image

Error when trying to compile image

rodja commented 4 years ago

Could you attach the csproj of your shared library? We normally use shared projects (.shproj with .projitems) which do not have the ability to add libraries by themself (see https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/shared-projects?tabs=macos). Do you have any particular requirement why you want to use a shared lib?

Silver7899 commented 4 years ago

Sorry maybe I'm confused about terminology because I'm a beginner

I tried using blank Xamarin Forms template. Using your library code in a shared project (not in a shared library)

App1.zip

rodja commented 4 years ago

The project you added has a netstandard2.0 library for the shared code. When I create a blank Forms App I'll get a shared project (see screenshot). Unfortunately we currently have not time to add support for netstandard2.0 libs. I suggest you use a shared project. You should be able to just delete your lib project and add a shared project instead.

selimgueler commented 3 years ago

I am getting the same error using the version 1.4.27. In my project netstandard2.0 libs are also used, no shared project. As far as I read the description for 1.4.27, it supports now the net2.0, doesn't it? Thanks.

rodja commented 3 years ago

I added the net2.0 target but as you wrote that still does not work. Is it possible for you to switch to a shared project as Xamarin recommends?

selimgueler commented 3 years ago

Thanks for the feedback. Unfortunately it is a little late for that, project almost done :-) However I've solved my issue with Xamarin.Essentials.Preferences.

Thank you again.

Grüße