Jordan
Jordan
CC#
Created by Jordan on 11/22/2024 in #help
Failed to install .NET9 on Raspberry PI
For reference, .NET 8 works fine. I installed the dotnet SDK using the following script and it successfully installed the 9.0 SDK to ~/.dotnet as it should.
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel STS
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel STS
But when trying to run any dotnet command, like dotnet run oder even dotnet --version i just get a error message complaining about the wrong glibc version.
▶ dotnet --version
dotnet: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found (required by dotnet)
▶ dotnet --version
dotnet: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found (required by dotnet)
All the debian/raspian packages are up to date with the latest version. Might this be another issue with the raspi being a arm based sbc? Or did I mess up somewhere? I also tried using the apt mirror but even after adding the entry to my sources list it does not find any dotnet sdk packages...
4 replies
CC#
Created by Jordan on 10/27/2024 in #help
Reflection Load Interface Instance
so i am loading plugins from multiple assemblies and i look for types Implementing the IPlugin interface. I then create an instance of that class (i tried both using activator and manual constuctor call) and when a look at the GetType from the instance i get back, i see the IPlugin and IDisposalbe interfaces listed as implemented on the Type Info, but when i try to cast/use the interface methods i simply get an exception or null (System.InvalidCastException: Unable to cast object of type 'TestPlugin.TestPluginClass' to type 'PluginBase.IPlugin'.
9 replies
CC#
Created by Jordan on 11/15/2023 in #help
How to hit internal API with Authentication in Blazor Server
Can anybody help me with this? I have a api endpoint in my controller:
[HttpDelete("delete/{id}")]
public async Task<IActionResult> DoSomething(int id)
{
var user = await userManager.GetUserAsync(User);
}
[HttpDelete("delete/{id}")]
public async Task<IActionResult> DoSomething(int id)
{
var user = await userManager.GetUserAsync(User);
}
And i have a Blazor page where i want to invoke that:
private async Task MyAction()
{
var result = await HttpClient.DeleteAsync($"/api/mycontroller/delete/{someId}");
}
private async Task MyAction()
{
var result = await HttpClient.DeleteAsync($"/api/mycontroller/delete/{someId}");
}
I am logged in on my Blazor page and I want to pass along the identity/authentication to the api controller. In my case, the GetUserAsync on the controller side always returns null. I am using the default Identity.Application authentication sheme. I tried modifing the request header with the data from the IHttpContextAccessor but I didnt get it to work and i dont think this is the way you are supposed to do this.
1 replies