Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net Standard #9

Open
MaxThom opened this issue Aug 24, 2020 · 9 comments
Open

.Net Standard #9

MaxThom opened this issue Aug 24, 2020 · 9 comments

Comments

@MaxThom
Copy link

MaxThom commented Aug 24, 2020

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
Copy link
Member

rodja commented Aug 25, 2020

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
Copy link
Author

MaxThom commented Aug 26, 2020

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

@Silver7899
Copy link

Silver7899 commented Aug 28, 2020

Same problem.
Package installed in all projects.
1

Using code in shared project App.xaml.cs
image

Error when trying to compile
image

@rodja
Copy link
Member

rodja commented Aug 28, 2020

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
Copy link

Silver7899 commented Aug 28, 2020

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
Copy link
Member

rodja commented Aug 29, 2020

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
Copy link

selimgueler commented Oct 5, 2020

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
Copy link
Member

rodja commented Oct 6, 2020

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
Copy link

selimgueler commented Oct 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants