|
Thank you that was very helpful.
|
|
|
|
|
Supported formats include Excel, PDF, Word, and Image.
Note that this specifically does not mention HTML in any form.
You can use the LocalReport.ListRenderingExtensions method[^] to get the list of supported formats.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you. That was very helpful.
|
|
|
|
|
Morning everyone,
less a question but more a discussion.
I am tasked to create a Blazor page we will use to track our RSS or Atom Feeds of interest, which we check regularly and validate if anything related to our work is posted.
I was thinking about displaying the feed contents as markup string, so you'll also be able to read the article directly within the app instead of navigating to the website.
The feed will only be displayed, the data to be stored is detached from the display and will only track if someone of the team has read and validated that article. But i am a bit unsure if that would be a good apprach, with markdown for the display the app would be vulnerable for XSS, but on the other hand if the feed was malicious and the collegue naviagates to the article the XSS could trigger on the corresponding page then.
Am i a bit too cautious on that topic or would you as well only provide a link to the article? I feel it would be neat if you could read the article directly in that app but i am afraid it may cause a security issue.
As a side note i also must admit that we are ordered to limit our usage of 3rd party libs, which would probably help on sanitising the feed contents, although, as written above there is always the option to navigate to the article which just "outsources" the problem.
Thanks for your answers in advance.
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
Hello Beautiful People,
I do photography as a hobby and also play games. As such, I often use SDR mode for the desktop / photography side, but want to swap to HDR mode for playing some games.
Being a bit forgetful, I’ll launch a game from Steam/GOG only realise that I forgot use Win + Alt + B to toggle HDR. Now I have to sit through all the opening movies before I can exit the game, manually turn on HDR then relaunch.
I’d like to develop my own launcher that will allow me to toggle HDR mode prior to calling Steam/GOG to launch a game.
Does anyone know if toggling HDR mode is possible in C# please?
Thanks for your time,
MrCrane.
|
|
|
|
|
There is an MS API which might let you do it: XDisplayTryEnableHdrMode - Microsoft Game Development Kit | Microsoft Learn[^] but you'd have to work out the DLLImport signature for yourself - I've never wanted to use it!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello OriginalGriff,
Thank you for taking the time to reply.
Best regards,
MC
|
|
|
|
|
For something completely different. You could try to create a shortcut or batch file to run an Autohotkey script to change the setting then start the game.
GOG games should be easy, and you might be able to run the steam games from the desktop shortcut steam can create.
Just a thought.
Ron
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
I have an internal nuget. It pulls in the nuget for NSB 7.5.
The dependency info clearly shows it is pulling in 7.5.
However, when I then pull my internal nuget into a project, it attempts to put NSB 8.0 as the transient NSB dependency for the internal nuget.
I do not at all understand why this is happening or how to fix it. Has NSB messed up their nugets? What am I missing? Help. Please.
|
|
|
|
|
Why have you posted this in the C# forum? It clearly has nothing to do with writing C# code.
|
|
|
|
|
Well, you're very right. But also, very wrong.
|
|
|
|
|
Well that does not explain anything. If you want people to help you then you need to give proper details of your problem. And I still cannot see anything relevant to C# in your question.
|
|
|
|
|
Nevermind, I'll ask stack overflow. They're nicer about these things.
Seriously, this is the first thing I think I've ever asked here. Maybe .NET would be better, but I think if there are people who would have this answer they more likely to poke here.
|
|
|
|
|
jochance wrote: Seriously, this is the first thing I think I've ever asked here. Well after the other 300 odd messages you should know what the process is.
|
|
|
|
|
Sorry, I do not care about or for your pedantry. I simply do not.
|
|
|
|
|
|
Is there a better forum to ask questions about VS projects?
I can seem some overlap with others (like Managed C++) but nothing that seems to be specific about VS Projects.
|
|
|
|
|
It could go in .NET Core but... It's just the case here is going to more likely get the right eyes.
It doesn't really matter now. Fixed. (another nsb nuget was the cause, it required higher, so it was forcing it to pull a higher version - that nsb nuget was only in the top-level, so wasn't seeing that happen pulling this same thing into others).
My biggest beef is just the absolute ham-fisted pedantry. But it isn't like I ask or answer questions much here nor is it exactly inspiring to do so in the future. Maybe that's the point? Imaginary internet point hoarding?
Maybe it's just been a long day. Will never much care for that kind of stuff though.
|
|
|
|
|
|
I don't see anything in the question relevant to VS either. And I did ask OP to clarify his problem, but seems he wasn't interested.
|
|
|
|
|
Richard MacCutchan wrote: relevant to VS either
From the post
"when I then pull my internal nuget into a project,"
I figured that mean using a project via VS.
One can manage them outside of VS but I doubt many people do. Certainly I would presume that most do it in VS so that is how I read it.
|
|
|
|
|
It seems that the .NET 8 infrastructure code that interacts with the service control manager provides a layer of abstraction over the Start and Stop commands.
Therefore I don't see how to directly issue a service stop command. The service is passed a CancellationToken object, but I've been informed that you can't cancel such a token without access to the CancellationTokenSource.
When the service runs, all I have is the token, not the source.
So how do I shutdown and exit the service from code running inside the service?
SOLUTION:
Below is the template code produced by Visual Studio when you create a .NET 8 Windows service:
I simply created a property on the service class itself that can be set from inside the service and indicates to the outside world whether the service wants to shut down.
I called it StopFlag .
public sealed class WindowsBackgroundService(
MyWindowsService myWindowsService,
ILogger<WindowsBackgroundService> logger) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
try
{
myWindowsService.OnStart(new string[0]);
while (!stoppingToken.IsCancellationRequested && !myWindowsService.StopFlag)
{
await Task.Delay(TimeSpan.FromSeconds(1), stoppingToken);
}
}
catch (OperationCanceledException)
{
}
catch (Exception ex)
{
logger.LogError(ex, "{Message}", ex.Message);
Environment.Exit(1);
}
}
}
The difficult we do right away...
...the impossible takes slightly longer.
modified 11-Feb-24 15:36pm.
|
|
|
|
|
|
Griff, thanks for the reply.
The method and object you mention are only in the .NET Framework.
I recently upgraded the service to .NET 8, which uses a different paradigm.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Store a "semaphore" (or "command code") somewhere and have the service look at it every so often. Use pull instead of push, and let it shut itself down.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|