Replies: 4 comments 1 reply
-
It appears that this is a mystery. I'm finding that closing VS and then reopening VS with the project in it seems to solve the problem. I've run into similar problems where VS thinks there is no error but a compile shows an error which VS will then recognize and display in the error list. Not an answer, just an observation. |
Beta Was this translation helpful? Give feedback.
-
Hey, |
Beta Was this translation helpful? Give feedback.
-
Have tried the latest version? Works fine on my end. |
Beta Was this translation helpful? Give feedback.
-
Hello Team, I am facing below issue And My Visual Studio configuration details : Please do the needful. Thank You in advance!! Regards, |
Beta Was this translation helpful? Give feedback.
-
I've got a project I started on a couple of weeks ago. I've started noticing this weird behavior in VS. I'm on 17.3 Preview 6 on windows11, but i've noticed this off and on with earlier previews as well. I've added the ZXing scanner from Jon Dick. I have the code below in my MauiProgram.cs file. Vs is reporting the following errors below. This had previously worked as recently as last weekend. The error appears to be from the windows build. I go into the project properties and I tell VS to not build for windows by unclicking the checkbox to build for windows, and VS immediately rechecks the checkbox. I feel like I am stuck. what is the correct process to not get this error besides unclick to build for windows? If I have selected my attached android phone as the current debug target, why is it trying to build for windows? What do I need to do on my end to not get this error and debug? TIA
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'ZXing' could not be found (are you missing a using directive or an assembly reference?) ScanAndScoringMauiApp (net6.0-windows10.0.19041.0) C:\SoftwareSource\ScanAndScoreClientMaui\ScanAndScoringMauiApp\MauiProgram.cs 1 Active
Severity Code Description Project File Line Suppression State
Error CS1061 'MauiAppBuilder' does not contain a definition for 'UseBarcodeReader' and no accessible extension method 'UseBarcodeReader' accepting a first argument of type 'MauiAppBuilder' could be found (are you missing a using directive or an assembly reference?) ScanAndScoringMauiApp (net6.0-windows10.0.19041.0) C:\SoftwareSource\ScanAndScoreClientMaui\ScanAndScoringMauiApp\MauiProgram.cs 14 Active
[using ZXing.Net.Maui;
#if ANDROID
[assembly: Android.App.UsesPermission(Android.Manifest.Permission.Camera)]
#endif
namespace ScanAndScoringMauiApp;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp().UseBarcodeReader()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
}
](url)
Beta Was this translation helpful? Give feedback.
All reactions