0
votes

I have a .netstandard Model layer that referenced from Xamarin.forms.

I set Xamarin.Forms package in Model layer => PrivateAssets="All".

My .netstandard Data layer referenced from Model layer.

When I run this command in PowerShell :

dotnet ef --startup-project ../Eela.Web/ migrations add v1

I have this error :

C:\Users*.nuget\packages\xamarin.forms\2.3.4.231\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets(40,3): error MSB4062: The "Xamarin.Forms.Build.Tasks.FixedCreateCSharpManifestResourceName" task could not be loaded from the assembly C:\Users*.nuget\packages\xamarin.forms\2.3.4.231\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [.....\Eela.Model.csproj]

Even I'm using :

<PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8</PackageTargetFallback>

in Data layer but the problem is persisted,

Is there any way to resolve this problem ?

1

1 Answers

1
votes

I did not use the migrations with EntityFramework core in a xamarin forms app. I just used

await db.Database.EnsureCreatedAsync()

If you add a .net core console app to the solution I think you can you can use migrations.