-
Notifications
You must be signed in to change notification settings - Fork 24
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
Targeting core .NET SDK is not supported #6
Comments
@rafalka I'm sorry I have no idea why do you need the Sample project to support net7.0 or net8.0. The Sample project is a consumer project which must target to a specific OS platform. The FFImageLoading.Maui project is referenced by the FFImageLoading.Tests project which is only for unit-testing. So I add net7.0 and net8.0 support for FFImageLoading.Maui project, but it also has some tricky walkaround not fully support. If you have some specific reason for this need, you can tell me here. |
Hi @microspaze, In real life you want to create a unit tests for your MAUI app, so this app need to compiled as a library and must support the core .NET. |
We have the same problem, to support that we can add some compile condition to exclude Image in test configuration, or add suport by adding this library into platform lib implementation. It's not best solutions and i after that we create many redundant code |
@michal-ziolkowski-dev: Alternatively you can create stubs form missing classes/methods which will be compiled only on dotnet core: namespace FFImageLoading
{
public class ImageService
{
public IConfiguration Configuration => null;
public void InvalidateMemoryCache() { }
public Task InvalidateCacheAsync(CacheType all = CacheType.All) => Task.CompletedTask;
public Task InvalidateCacheEntryAsync(string source, CacheType all = CacheType.All, bool ignore = false) => Task.CompletedTask;
public Work.TaskParameter LoadUrl(string toString) => null;
}
}
namespace FFImageLoading.Work
{
public static class TaskParameterExtensions
{
public static TaskParameter Preload(this TaskParameter parameter, ImageService _) => parameter;
}
}
namespace FFImageLoading.Transformations
{
public class CornersTransformation : ITransformation
{
public double TopLeftCornerSize { get; set; }
public double TopRightCornerSize { get; set; }
public double BottomLeftCornerSize { get; set; }
public double BottomRightCornerSize { get; set; }
public double CropWidthRatio { get; set; }
public double CropHeightRatio { get; set; }
public CornerTransformType CornersTransformType { get; set; }
public CornersTransformation(double cornersSize, CornerTransformType cornersTransformType)
{
}
public CornersTransformation()
{
throw new NotImplementedException();
}
public IBitmap Transform(IBitmap sourceBitmap, string path, ImageSourceType sourceType, bool isPlaceholder, string key)
{
throw new NotImplementedException();
}
public string Key { get; }
}
public class CircleTransformation : ITransformation
{
public double BorderSize { get; set; }
public string BorderHexColor { get; set; }
public IBitmap Transform(IBitmap sourceBitmap, string path, ImageSourceType sourceType, bool isPlaceholder, string key)
{
throw new NotImplementedException();
}
public string Key { get; }
}
} |
@rafalka works for me on the lates version 1.0.8 |
Description
First of all: thank you for great job with porting this lib to MAUI.
Unfortunately this port has serious architecture issue:
Not all classes are exported when targeting core (ie
net7.0
instead ofnet7.0-android
) .NET SDK breaks compilation of project which uses them.This issue blocks any possibility of unit testing of MAUI app.
Steps to Reproduce
samples/Sample/Sample.csproj
net7.0
toTargetFrameworks
Expected Behavior
Project will compile
Actual Behavior
Several compilation errors related with missing
CornersTransformation
,GrayscaleTransformation
, ....Basic Information
Screenshots
N/A
Reproduction Link / Code
N/A
The text was updated successfully, but these errors were encountered: