Comments (17)
I think I found a hack to fix it:
<ItemGroup Condition=" 'dog' == 'cat' ">
<NativeReference Include="BadFile.dylib" />
</ItemGroup>
<ItemGroup Condition=" 'dog' != 'cat' ">
<NativeReference Remove="BadFile.dylib" />
</ItemGroup>
This is all sorts of wrong, but the IDE seems happier.
from skiasharp.
I get this as well. It has been around for a while #2223. Using VS2019 16.11.35.
from skiasharp.
It's, at the very least, annoying. But it also leaves me wondering what I need to distribute in order to ensure that the software works without issues.
Please address this.
from skiasharp.
Any chance of a response from the Team? Even merely an acknowledgement that the issue has been noted and understood?
from skiasharp.
Issue still persists in the nuget packages for skiasharp 2.88.8
from skiasharp.
This is the code that is importing the native reference:
It has a condition that is not ever true on Windows, VS for Windows or WPF. Yet somehow the IDE is seeing it.
It does seem to only happen in the classic projects, so a workaround may be to upgrade to the SDK-style projects.
from skiasharp.
Sorry can you explain what you mean by "classic" and "SDK-style" projects?
We are using a product called Aspose.Words in a Solution with 84 projects in it. That product has now been changed to include references to SkiaSharp and that's how the nuget packages for SkiaSharp ended up pulled into our Solution. I am not sure that we can justify the amount of work involved in the workaround...
from skiasharp.
This appears to be a IDE warning, and not a compile warning. So the IDE is doing this all on its own and we have no way to control it. It should not be happening as there is a condition around it that is false. Looking at a binlog, this warning does not exist - and it does not have a code either so we cannot ignore or even do anything.
from skiasharp.
SDK style projects are the new way to write csproj: https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview
For example, a File | New project will look like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
All the clutter has been removed.
from skiasharp.
You can also easily update from the old projects to the new project with the .net upgrade assistant: https://dotnet.microsoft.com/en-us/platform/upgrade-assistant
This will not actually upgrade anything with your app, just the csproj format.
Running a test now to confirm...
from skiasharp.
Okay but this is a years old solution and we're stuck in .NET Framework 4.8 world so a move to .NET Core is not going to happen any time soon.
I had a look at the code you posted, though ... and I think I can see what the problem is.
<ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' ">True</ShouldIncludeNativeSkiaSharp>
So there is a condition under which the value is set to True, but there is no condition under which the value is set to False, so as far as I can tell from the code snippet, the value could be anything: '', 'george', 'something' or even null.
Similarly, the _AppIsFullMac value is set on the basis of various values != to some values, and again, I bet those values are not the "opposites" you're expecting them to be.
from skiasharp.
The condition is working as the second part ``'$(_AppIsFullMac)' == 'True' is false. When running a build, there is no warning and there is also all the cases where the checks are running and there are no native references:
Also, switching to SDK-style projects does not mean switching to .net core, you can just convert the xml to the modern format, and keep the same net46/net47/net48 that you already have - and you can mix it up as well.
But again, this is not a build issue - just the IDE/solution explorer bug.
from skiasharp.
Okay but it pollutes our "Error list" with spurious warnings. We are not in the habit of ignoring warnings as we've been bitten a few times before when an ignored warning led to an actual problem. With all these warnings cluttering the Error List we're risking missing one that DOES require our attention. If it's an IDE bug, where can I report that and ask the makers of Visual Studio to address it?
from skiasharp.
I even wrapped the whole <NativeReference>
item in a <ItemGroup Condition=" 'cat' == 'dog' ">
and the IDE still sees it.
You can use the VS feedback in the help menu or the
I will try replicate this in a simple project for you to add a code snippet.
from skiasharp.
Managed to reproduce this with the simplest thing:
<ItemGroup Condition=" 'dog' == 'cat' ">
<NativeReference Include="BadFile.dylib" />
</ItemGroup>
Add that near the end of your csproj and the warning will appear. The condition directly excludes this, yet it is still there in the IDE.
from skiasharp.
Let's see.
from skiasharp.
Thank you so much for putting effort into this
from skiasharp.
Related Issues (20)
- [BUG] XAML Live Preview for Android shows most SKCanvasViews distorted (Visual Studio 2022 17.10 Preview 2 / .NET 9.0 Preview 2)
- [FEATURE] Support Direct3D HOT 4
- [BUG] `SKNativeObject` instances are not kept alive during native API calls
- [BUG] Text Missing When Running From AWS Lambda HOT 3
- [BUG] SkiaSharp 3.0 Preview 3.1 crashes the release version of the .NET MAUI app at start, debug works fine HOT 9
- [BUG] Drawing is warped during window resize on NVIDIA graphics card
- Canvas Info shows huge size when using Chrome Debugger and using Device Emulation
- [BUG] Build outputs duplicate native libraries HOT 2
- Skia Blazor Runs in debugger but not when deployed
- [BUG] SKGLElement gives black screen on Intel integrated graphics
- [BUG] SKGLView on .NET MAUI is missing a handler (the return) HOT 6
- [BUG] On iOS, with .NET 9.0 Preview 2 and 3 and SkiaSharp 3.0 Preview 2.1 / 3.1, SKGLView corrupts SkiaSharp memory and stops SkiaSharp from functioning HOT 8
- [BUG] The position draw on SKXamCanvas is not correct. #1585 Was this a bug that you worked around? HOT 3
- [PERFORMANCE] On iOS, layout speed of pages with SKGLView is slow, making layout wobbly at start (SKCanvasView is instantaneous)
- [BUG] SkiaSharp 2.88.8 (Xamarin) crashes randomly with Mali GPUs HOT 4
- [BUG] SKPaint's IsAntiAlisasing is on on Android but off on iOS by default (Xamarin / SkiaSharp 2.88.8) HOT 1
- [BUG] SkiaSharp crashes in WebAssembly if building with non-Release/Debug build config HOT 1
- [BUG] Canvas.DrawPath Cause Memory Leak on Windows 11 HOT 1
- [BUG] SKBitmap.ColorSpace is always null. Unable to check for CMYK, RGB, etc. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skiasharp.