"Object reference not set to an instance of an object"
code: https://github.com/axololly/chess/tree/main/Board.cs#L1073
not sure why this is happening. i changed the
Board
from a class
to a struct
so it's no longer heap allocated (used in an engine, so these things matter) and now it's raising weird errors like this...✅ Not sure why im getting this error
Haven't deleted any thing from the design just double clicked the button and started to write code and I get this.
✅ how can i install node.js module in visual studio community app
helloo,I want another .bat application to open when I press the button on my form in visual studio community application, but when I press the button, it says Node.js module not found, how can I add this module to my visual studio community form?
✅ Array wont fully print out Windows Forms App
Hiya new to WDF trying to output a full aray ive looped through. Though it only displays the last string in the array "King spades" Wondering why this happens
✅ Use Sqlite in a C# project
Hello, I'm trying to use Sqlite for the first time but I'm getting the following error when creating a connection.
```csharp
using System.Data.SQLite;
...
new SQLiteConnection(connectionString);...
In Memory DATABase troubles
Some slight issues and code fix ups
```cs
public class InMemoryDatabase
{
public Dictionary<int, Person> People = [];...
making interface button
im just having trouble somehow implementing a button, i tried watching a tutorial but he talks about so many complex thijgs such as an eventHandle clikc and later doing click?.invoke(this, eventargs) that it just didnt make sense to me... so how would you go about making a button for my homeScreen (the homeScreen is one of the screens on my interface)
i sorrta can map out what to do just do not know hwo to, i guess id have to make a button class with a texture,position and rect along with draw and load methods but i tried this and couldnt pass down the contentmanager to load the textures eyc, i also tried passing it down in my screenManager but then i had to make whole new instances of the object in my methods and it would never be able to load the textures it needed to draw them out, so nothing would be output onto the screen e.g
public Load(){...
WPF Submenu Styling
I can't seem to figure how to get rid of the border in submenus in WPF. More specifically, can't figure out how to get rid of that border.
For minimum repo, create a new WPF application and have this as your MainWindow's xml file::
```cs...
win32 island in wpf application has #f0f0f0 background colour
hii!! i'm working on a project which requires an embedded win32 control. however, the background of the island is always #f0f0f0 instead of #ffffff. this occurs even if the window is hosting no control and is just a child window. see the attached image for an example
Forwarding calls to string.Create with custom culture info.
Hi. I have been trying to create a method to help us to do string interpolation using invariant culture. string interpolation picks up the current thread culture when formatting numbers and such and that can lead to surprises.
```csharp
// x might be "0.00" but on my machine it is "0,00"
var x = $"{0.00:0.00}";...
✅ this error makes no sense
getting a null reference exception here:
...
static Evaluation eval = new();
static Evaluation eval = new();
Exceptions.
We have the same code.
When i type
4/3
my program crashes with the error (picture).
When my colleague types 4/3
he gets it written to the output and the program continues. Why?...Managing Scoped Service Lifecycles with a Singleton Factory in .NET: Best Practices?
Hello everyone,
I'm working on implementing a factory pattern for payment services in a .NET application and I'm unsure about properly managing the lifecycle of services. Here's the relevant part of my code:
```public class ProviderServiceFactory
{
private readonly IServiceProvider _serviceProvider;...
Blazor Isolated CSS not working
I have a Blazor app in InteractiveAuto mode and isolated css stopped working. I am not sure when it stopped working or what I changed. The attributes of the affected html elements are generated correctly. The generated css file contains the following:
I don't believe that the isolated css file is relevant since I tried removing all css I added myself, but I will provide it anyway:
```css
#blazor-error-ui {...
@import 'ChemStore.Web.Client.bundle.scp.css';
@import 'ChemStore.Web.Client.bundle.scp.css';
Dependency Injection question
I was learning about coupling/decoupling and one thing that was confusing to me was this:
Basically, people tell you to leave the instances for the calling of the constructor method, and instead just use an Interface that implements that class when using it on your code.
The reason people will say this is useful includes (while not limited to) "Making so that if the signature of that class changes, the code using that class won't be affected, since it's using an abstraction of it, an Interface. Making it easier to change the class without breaking the code"...
C# backend vs Java backend
Hello, I will enter a long bootcamp and I am very undecided about which one to go with, there are 2 options in front of me, Java and C#. I could not decide even after my research on the internet. Can you please answer objectively, which way should I go?