-
Notifications
You must be signed in to change notification settings - Fork 29
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
Can't add to a project if plain net8.0 support is present #21
Comments
I'm going to look at merging this PR, but to be honest I'm conflicted. You shouldn't be trying to reference this type from net8.0 in your project. Can you provide more info about what code you are trying to use that is giving you this error? |
Just added the net8.0 TF to support a test project |
If u can recommend any other way to make a unit test project work with MAUI would be grateful! |
My team are experiencing the same issue due to having a test project in our solution. That PR would greatly help us. Currently we are working around by doing the below in our MauiProgram: public static MauiAppBuilder ConfigureVirtualListView(this MauiAppBuilder mauiAppBuilder)
{
#if IOS || ANDROID
mauiAppBuilder.UseVirtualListView();
#endif
return mauiAppBuilder;
} And to create a custom adapter creating the below classes: #if NET && !IOS && !ANDROID
namespace Microsoft.Maui.Adapters
{
public interface IVirtualListViewAdapter
{
void InvalidateData();
}
}
#endif #if NET && !IOS && !ANDROID
namespace Microsoft.Maui.Adapters
{
public abstract class VirtualListViewAdapterBase<TSection, TItem>
where TItem : class
{
public abstract TItem GetItem(int sectionIndex, int itemIndex);
public abstract int GetNumberOfItemsInSection(int sectionIndex);
}
}
#endif |
And to get the view working we did the below: namespace MyHealth.Controls
{
public class VirtualListView : Microsoft.Maui.Controls.VirtualListView
{
}
}
#if NET && !IOS && !ANDROID
namespace Microsoft.Maui.Controls
{
public class VirtualListView : View
{
// Fake properties, methods and events
}
}
#endif |
sill an issue with 0.3.2 |
Failing to build if added to such project, because of this:
The text was updated successfully, but these errors were encountered: