A real C++ vs C# story

2023-08-31 Thread Greg Keogh via ozdotnet
Folks, it's Friday and I have an anecdote to share before I return to
today's coding fiasco. I'll just tell you what happened and try to avoid
making judgements, I'll leave that to you.

For about 4 years we've had an Azure hosted Web API/service driving a
moderately complex Blazor app and some other smaller clients. The service
hosted a C++ library that did the heavy lifting of generating
cross-tabulation reports. The trouble was, that the service would randomly
crash deep inside the C++ dll and it would leave no useful diagnostic
evidence, usually just a hint about some kind of memory access violation.
It would never crash in testing, only in Azure. I presume here is a way to
diagnose this sort of crash in Azure hosting, but you probably need the
minidump and symbol files out of the C++ compile, I'm not exactly sure, as
I just couldn't face the toil, and by great luck it was due for replacement
anyway. Some very large US companies were suffering from the crash
interruptions and there was a serious risk that we could lose their
business.

The lucky part is that the huge C++ codebase was already being rewritten in
C#, so we went into a frenzy of continued conversion and testing, and the
C# replacement is now about 90% rolled-out. and guess what?! ... The random
crashes are gone and one customer even sent us a message of thanks for the
new reliability.

We did have a few small unhandled exceptions, but I simply went to the
Azure portal logs and the stack trace pointed us straight to the problem
point. We could usually publish a fix within half an hour.

So years of random C++ crashes were completely cured by a C# rewrite.

*Greg K*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: A real C++ vs C# story

2023-08-31 Thread Greg Keogh via ozdotnet
>
> I have never understood the fixation with C++ unless you're in the
> business of writing kernels, device drivers, embedded systems, etc.
>

The library we're phasing out was started around 1997, so you can throw the
authors a bone because the world was very different back then. Your main
choices were C/C++, VB and Java.

I stand by my opinion that C++ is the most absurdly complex and idiotic
language in contemporary use. Ooops! I made a judgement.

*GK*


>
> On Fri, 1 Sept 2023 at 08:44, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote:
>
>> Folks, it's Friday and I have an anecdote to share before I return to
>> today's coding fiasco. I'll just tell you what happened and try to avoid
>> making judgements, I'll leave that to you.
>>
>> For about 4 years we've had an Azure hosted Web API/service driving a
>> moderately complex Blazor app and some other smaller clients. The service
>> hosted a C++ library that did the heavy lifting of generating
>> cross-tabulation reports. The trouble was, that the service would randomly
>> crash deep inside the C++ dll and it would leave no useful diagnostic
>> evidence, usually just a hint about some kind of memory access violation.
>> It would never crash in testing, only in Azure. I presume here is a way to
>> diagnose this sort of crash in Azure hosting, but you probably need the
>> minidump and symbol files out of the C++ compile, I'm not exactly sure, as
>> I just couldn't face the toil, and by great luck it was due for replacement
>> anyway. Some very large US companies were suffering from the crash
>> interruptions and there was a serious risk that we could lose their
>> business.
>>
>> The lucky part is that the huge C++ codebase was already being rewritten
>> in C#, so we went into a frenzy of continued conversion and testing, and
>> the C# replacement is now about 90% rolled-out. and guess what?! ... The
>> random crashes are gone and one customer even sent us a message of thanks
>> for the new reliability.
>>
>> We did have a few small unhandled exceptions, but I simply went to the
>> Azure portal logs and the stack trace pointed us straight to the problem
>> point. We could usually publish a fix within half an hour.
>>
>> So years of random C++ crashes were completely cured by a C# rewrite.
>>
>> *Greg K*
>> --
>> ozdotnet mailing list
>> To manage your subscription, access archives:
>> https://codify.mailman3.com/
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Blazor popularity and use

2023-09-07 Thread Greg Keogh via ozdotnet
>
> Is anyone here actively using Blazor on a decent sized project? I used it
> for a while on my last contract but am unable to find new work anywhere
> that uses Blazor, not a single one!


Compared to server-side ASP.NET and JS Frameworks, Blazor is a gift from
heaven .. well ... sort-of. Here's a Friday story.

With the death of Silverlight, we had to replace an app with a quite rich
UI with something else, what?! Like many people, I was spitting chips angry
at the suggestion we must replace our Silverlight apps with HTML5 apps. The
idea that HTML+CSS+JS could replace a WPF-like rich web UI made me laugh
and cry at the same time.

Angular was really popular around 2018 so we got an offer to write a JS
replacement for $200/hr. I then decided to learn Angular and watched 5
hours of a 10 hour Angular course, at which point I gave up and said f**k
that s**t. Now what?

Luckily, Blazor 0.9 was in preview around this time. I spent a whole Sunday
afternoon experimenting with Blazor. By the end of the day I had quite a
sophisticated hobby app working with only a few hundred lines of coding,
thanks to the familiarity of using VS, C# and Razor markup (with a bit of
JS). The same app in ASP.NET would have taken 5 times as long and 5 times
the code. The same app in Angular would have required unfamiliar tooling
and millions of lines of script.

To answer your question, I have one quite complex Blazor app being used by
some huge US companies to analyse marketing data (using Telerik and
SpreadJS components to attempt to make charts and grids as fancy as was
possible in Silverlight). I have a couple of smaller apps in live use, and
few little ones for utility use.

I know the guys at Melbourne App Development
 are really keen on Blazor and were
using it for some serious apps just as it reached version 1.0. About 18
months ago, Adam Cogan at SSW said during the preamble to one of their
monthly presentations, that Blazor demand had overtaken JS.

I hope other people in here have similar stories.

I must end on a sad note. ASP.NET, Blazor, JS, or whatever, all finish-up
rendering in a web browser. It's tragic that the ancient dumb web browser
is now the only host for web apps, and that we must attempt to present
serious business applications using HTML, CSS and JS. The web browser was
invented so we could have flame wars and look at pictures of cats and porn,
it's barely evolved since then and it's completely inadequate for rendering
business applications. Sure it can, but look at the flaming hoops and all
the weird quirks you have to jump through. Web development is in a
lamentable state.

*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Blazor popularity and use

2023-09-07 Thread Greg Keogh via ozdotnet
If demand *for SSW* to use Blazor is overtaking JS, then I'd believe it. I
saw the statement made.

I've never met a living person who uses Flutter, or the Dart language for
that matter. It would be a brave decision to choose that as a development
platform for the future.

Does MAUI generate browser hosted web apps? I didn't think it was made for
that purpose, but maybe it does. I haven't looked yet.

If you don't want to use a JavaScript framework, then Webassembly is the
future. I see there is a proposal to take JavaScript out of the stack so
that Wasm can talk directly to the browser DOM, which I think would be a
great leap forward because the JS layer is an utterly useless link in the
chain. Then we can finally consign JavaScript to the rubbish bin of history
where it belongs.

*GK*

On Fri, 8 Sept 2023 at 12:47, Tony Wright via ozdotnet <
ozdotnet@ozdotnet.com> wrote:

> I agree. React demand is far higher than any other front end framework as
> far as I can see. Angular ticks all the corporate governance boxes but it
> is so unwieldy and requires so much boilerplate before getting to the
> business logic it has really lost the war. Most of it comes down to
> popularity. If something it discovered that it fast superior to everything
> else, you usually see it rocket up the list. Blazor doesn't seem to be
> doing that unfortunately. Vue should be more popular. NodeJs if you want a
> pure JavaScript approach. But if you don't want a JavaScript framework what
> choices do you have? .Net Maui? Flutter?
>
> On Fri, 8 Sep 2023, 12:31 pm DotNet Dude via ozdotnet, <
> ozdotnet@ozdotnet.com> wrote:
>
>> I find it very hard to believe Blazor demand has overtaken JS. That’s an
>> insane comment from Adam
>>
>> On Fri, 8 Sep 2023 at 12:05, Greg Keogh via ozdotnet <
>> ozdotnet@ozdotnet.com> wrote:
>>
>>> Is anyone here actively using Blazor on a decent sized project? I used
>>>> it for a while on my last contract but am unable to find new work anywhere
>>>> that uses Blazor, not a single one!
>>>
>>>
>>> Compared to server-side ASP.NET and JS Frameworks, Blazor is a gift
>>> from heaven .. well ... sort-of. Here's a Friday story.
>>>
>>> With the death of Silverlight, we had to replace an app with a quite
>>> rich UI with something else, what?! Like many people, I was spitting chips
>>> angry at the suggestion we must replace our Silverlight apps with HTML5
>>> apps. The idea that HTML+CSS+JS could replace a WPF-like rich web UI made
>>> me laugh and cry at the same time.
>>>
>>> Angular was really popular around 2018 so we got an offer to write a JS
>>> replacement for $200/hr. I then decided to learn Angular and watched 5
>>> hours of a 10 hour Angular course, at which point I gave up and said f**k
>>> that s**t. Now what?
>>>
>>> Luckily, Blazor 0.9 was in preview around this time. I spent a whole
>>> Sunday afternoon experimenting with Blazor. By the end of the day I had
>>> quite a sophisticated hobby app working with only a few hundred lines of
>>> coding, thanks to the familiarity of using VS, C# and Razor markup (with a
>>> bit of JS). The same app in ASP.NET would have taken 5 times as long
>>> and 5 times the code. The same app in Angular would have required
>>> unfamiliar tooling and millions of lines of script.
>>>
>>> To answer your question, I have one quite complex Blazor app being used
>>> by some huge US companies to analyse marketing data (using Telerik and
>>> SpreadJS components to attempt to make charts and grids as fancy as was
>>> possible in Silverlight). I have a couple of smaller apps in live use, and
>>> few little ones for utility use.
>>>
>>> I know the guys at Melbourne App Development
>>> <https://melbourneappdevelopment.com/> are really keen on Blazor and
>>> were using it for some serious apps just as it reached version 1.0. About
>>> 18 months ago, Adam Cogan at SSW said during the preamble to one of their
>>> monthly presentations, that Blazor demand had overtaken JS.
>>>
>>> I hope other people in here have similar stories.
>>>
>>> I must end on a sad note. ASP.NET, Blazor, JS, or whatever, all
>>> finish-up rendering in a web browser. It's tragic that the ancient dumb web
>>> browser is now the only host for web apps, and that we must attempt to
>>> present serious business applications using HTML, CSS and JS. The web
>>> browser was invented so we could have flame wars and look at pictures of
>>> cats and porn, it's barely evolved since then and it's

Re: Blazor popularity and use

2023-09-07 Thread Greg Keogh via ozdotnet
Sure, deploying a web app to a server is easier than distributing thick
client updates to many recipients, but that's a lucky side-effect. I stand
by my claim that the web browser is a woefully inadequate host for business
applications. I even have an example from today ...

A Blazor app version update was published, with some small fixes and UI
tweaks which required css changes. I get a report that some clients are
seeing parts of the page squashed or the text is ugly mixed sizes. After
some back-and-forth with suggested quick fixes, the only fix was to clear
the browser cache and restart the browser, which is really irritating for
non-technical clients. I'm sure there are ways around this problem, with
special meta tags or similar tricks, but it's more hoops to jump through
and a good example of just how crappy the web browser is for business use.

 -- *Greg*

On Fri, 8 Sept 2023 at 13:08, David Connors via ozdotnet <
ozdotnet@ozdotnet.com> wrote:

>
>
> On Fri, 8 Sept 2023 at 12:06, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote
>
>> I must end on a sad note. ASP.NET, Blazor, JS, or whatever, all
>> finish-up rendering in a web browser. It's tragic that the ancient dumb web
>> browser is now the only host for web apps, and that we must attempt to
>> present serious business applications using HTML, CSS and JS. The web
>> browser was invented so we could have flame wars and look at pictures of
>> cats and porn, it's barely evolved since then and it's completely
>> inadequate for rendering business applications. Sure it can, but look at
>> the flaming hoops and all the weird quirks you have to jump through. Web
>> development is in a lamentable state.
>>
>
> You have a short memory of what it was like deploying apps back when thick
> clients were the only option. Modern web has done more to streamline ops
> than anything else and reduced application deployment to pushing code to an
> app service and end-user deployment to pasting a link in an e-mail or IM.
>
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Blazor popularity and use

2023-09-07 Thread Greg Keogh via ozdotnet
I'm glad I'm not the only grumpy old fart in here! -- *GK*

On Fri, 8 Sept 2023 at 13:44, Dr Greg Low  wrote:

> Yep, we talk about browsers like there’s consistency there. There still
> isn’t. And it’s a huge hit on productivity. I see so much lost effort
> trying to align pixels across different browsers, different versions of
> browsers, etc. It’s just silly.
>
>
>
> I remember being on a web app project. I was doing the data bits, and
> there were 10 devs doing the web parts.
>
>
>
> After 6 months, I looked at what the other 10 had produced and knew I
> could have built that myself in a winform app in a fortnight, by myself.
>
>
>
> But, no, they didn’t have to deal with “DLL-hell” from the thick clients.
>
>
>
> Yet now, every time I open a VS project that I haven’t touched for a few
> months, I totally cringe. Instead of DLL-hell on deployment, I now usually
> have “dependency-hell” with multiple inconsistent updates to dependent
> frameworks. Sometimes I can’t even work out how to resolve it and must
> reimplement part of the code.
>
>
>
> What we as an industry have done to productivity is tragic.
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile
>
> SQL Down Under | Web: https://sqldownunder.com | About Greg:
> https://about.me/greg.low
>
>
>
> *From:* Greg Keogh via ozdotnet 
> *Sent:* Friday, September 8, 2023 1:30 PM
> *To:* ozDotNet 
> *Cc:* David Connors ; Greg Keogh 
> *Subject:* Re: Blazor popularity and use
>
>
>
> Sure, deploying a web app to a server is easier than distributing thick
> client updates to many recipients, but that's a lucky side-effect. I stand
> by my claim that the web browser is a woefully inadequate host for business
> applications. I even have an example from today ...
>
>
>
> A Blazor app version update was published, with some small fixes and UI
> tweaks which required css changes. I get a report that some clients are
> seeing parts of the page squashed or the text is ugly mixed sizes. After
> some back-and-forth with suggested quick fixes, the only fix was to clear
> the browser cache and restart the browser, which is really irritating for
> non-technical clients. I'm sure there are ways around this problem, with
> special meta tags or similar tricks, but it's more hoops to jump through
> and a good example of just how crappy the web browser is for business use.
>
>
>
>  -- *Greg*
>
>
>
> On Fri, 8 Sept 2023 at 13:08, David Connors via ozdotnet <
> ozdotnet@ozdotnet.com> wrote:
>
>
>
>
>
> On Fri, 8 Sept 2023 at 12:06, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote
>
> I must end on a sad note. ASP.NET, Blazor, JS, or whatever, all finish-up
> rendering in a web browser. It's tragic that the ancient dumb web browser
> is now the only host for web apps, and that we must attempt to present
> serious business applications using HTML, CSS and JS. The web browser was
> invented so we could have flame wars and look at pictures of cats and porn,
> it's barely evolved since then and it's completely inadequate for rendering
> business applications. Sure it can, but look at the flaming hoops and all
> the weird quirks you have to jump through. Web development is in a
> lamentable state.
>
>
>
> You have a short memory of what it was like deploying apps back when thick
> clients were the only option. Modern web has done more to streamline ops
> than anything else and reduced application deployment to pushing code to an
> app service and end-user deployment to pasting a link in an e-mail or IM.
>
>
>
>
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
>
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Junked business registry overhaul blew out by $2.3b

2023-08-29 Thread Greg Keogh via ozdotnet
>
> Maybe we should set up OzDotNet Consultants specializing in government
> contracts? We could be swimming in cash!
>

Yeah, when I see news about a planned $4bn IT project going ahead, I think
"I'll get some mates together and do it for half the price".

A replacement MYKI system, no problems. As Homer Simpsons often says, "How
hard can it be?"

 --
*Greg K*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

[OT] Identifying domain details

2023-11-01 Thread Greg Keogh via ozdotnet
Folks, I'm preparing the paperwork to take some fraudulent plumbers to the
Magistrate's Court for "recovery of civil debt". Background information is
on my web page SCAM - KM Heating & Cooling
.

As part of the case I'm going to ask if an order can be made to shut down
the matching fraudulent website at kmheatingandcoolingplumbers.com.au and
(hopefully) have the domain registration cancelled.

Can any network boffins in here tell me what identifying whois and similar
domain information can be extracted for me to add to the case?

*Consider replying to my personal email because this is not of further
interest to the group.*

Cheers,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Minimal Web API code helper package

2023-10-30 Thread Greg Keogh via ozdotnet
>
> I think the package you are looking for is Carter
>
>
>
> https://www.nuget.org/packages/Carter
>
> https://github.com/CarterCommunity/Carter
>

Folks, some quick feedback. Carter wasn't quite as attractive as I guessed.
It adds too much of what I call "magic plumbing" and lots of fluent methods
for validation and authorisation that weren't of much use for me. I didn't
want to get married to another framework without a good reason, so I
skipped it and moved all my endpoint methods into a partial class:

static partial class Program
{
  public static void MapEndpoints(IEndpointRouteBuilder app,
WebApplicationBuilder builder)
  {
app.MapPost(...) { etc }
// etc
  }
}

I call  MapEndpoints(...) during program startup and it separates all that
code into a separate file, and for a good reason ... I use a T4 template to
generate about 1000 lines of repetitive app.mapxxx(...) calls into that
partial file.

*Greg K*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Minimal Web API code helper package

2023-10-18 Thread Greg Keogh via ozdotnet
Folks, a couple of weeks ago I was watching a video where someone used a
NuGet package in a minimal Web API project to change the plumbing slightly
so that it was easier to code the endpoint methods. By default, the
endpoint methods must be strictly coded and it's tricky to break them apart
or make partial methods. The package I saw added some magic to make coding
the endpoints easier, but I can't remember exactly how. I just remember
thinking "that looks handy" and now I can't find it. Any idea what it might
have been?

*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Minimal Web API code helper package

2023-10-18 Thread Greg Keogh via ozdotnet
>
> I think the package you are looking for is Carter
>
> https://www.nuget.org/packages/Carter
>
> https://github.com/CarterCommunity/Carter
>

Yes thanks, that looks familiar.

It doesn't look quite as *clever* as I recall, but I'll look into it
anyway. I tried something vaguely similar myself last year, but it's time
to revisit the issue and see how someone else tackled the matter.

*Greg*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Web app deploy without Visual Studio

2023-08-21 Thread Greg Keogh via ozdotnet
Folks, I have a Blazor app and a Web API that I need to "give" to someone
to install in their own Azure subscription. I have only ever published to
Azure from Visual Studio via right-click and make some publish profiles. In
other cases I would create a Web Setup project and give someone an MSI
file, but I doubt if that's useful for deploying to Azure.

I've been searching and searching, but most results talk about Visual
Studio publish, and a few talk about using DevOps pipelines, but none of
those are suitable because the customer has a personal Azure subscription
that I can't access.

Is there some dotnet command switch to generate some kind of "package"?
Maybe there are other options I haven't stumbled on.

Thanks,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Junked business registry overhaul blew out by $2.3b

2023-08-29 Thread Greg Keogh via ozdotnet
Couldn't they recruit enough COBOL programmers?

*Greg K*

On Tue, 29 Aug 2023 at 16:30, mike smith via ozdotnet 
wrote:

> Here's a non paywalled one
>
>
> https://www.innovationaus.com/burning-12m-a-month-govt-scraps-business-register-overhaul/
>
>
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Junked business registry overhaul blew out by $2.3b

2023-08-29 Thread Greg Keogh via ozdotnet
>
> Worse, they were probably drowning in XML schema definitions.
> Only one mention of XML in the redacted report, but three mentions of
> SBR1, so that still counts. 
>

Aha!  That leads to a bit of IT tech talk I can sort-of understand:

The MBR’s starting point for the technology architecture was Foster Moore’s
124 registry software, Catalyst. Catalyst was selected as the
commercial-off-the-shelf product for the MBR implementation, following a
formal approach to market and design validation with Foster Moore. 125
During the course of the program, the implementation changed to a later
version of Catalyst called Verne.

Verne is a cloud-hosted registry product that uses Linux/Unix OS and a
document database that is suitable for registries. It uses a lesser-known
Java-based programming language called Groovy. 126 Verne provides
out-of-the-box functionalities for registration management, client
management, content management, access management, configuration
management, analytics and reporting, data provision, account management,
communication management, document management, API management, and fee and
revenue management. The user interface framework provides a flexible way to
generate XML based APIs.


I've heard of Groovy , but now
I see it's a Java-like static or dynamic language. Foster Moore's Verne
 software is some gigantic off-the-shelf
corporate registry software product that claims to be highly configurable.
There's no mention of what back-end database it uses.

*Greg K*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Junked business registry overhaul blew out by $2.3b

2023-08-29 Thread Greg Keogh via ozdotnet
>
> You can also read the review. It’s available online. Riveting stuff, and
> of course, with lots redacted because we wouldn’t want to name names.
>
>
> https://treasury.gov.au/sites/default/files/2023-08/review-modernising-business-registers-program-report-redacted_0.pdf
>

I can't read 340 pages this afternoon, I have some coding to do!! I did
notice there are 48 impacts in the document, like:

program impacts
adversely impacted
material impact
do not impact
impacted agencies
change impact
severely impacted
market impacts
negative impact
no cash impact
intended impacts
directly impact
clearly impact
economic impact
financial impact

*Greg K*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

SQL Server Performance monitoring

2023-07-30 Thread Greg Keogh via ozdotnet
Folks,

We have a problem on a live server where web users experience occasional
unpredictable "stalls". There are a few links in the chain where the
problem could be, but based on some clues in logs, I suspect that it's the
last link at the bottom of the chain ... SQL Server that's the source of
the problem.

But I need evidence. Is there some feature of SQL Server or perhaps some
tool that can detect queries that are suspiciously long running? This is
SQL Server full standard edition. I haven't had to poke deeply into SQL
Server's machinery before, so I'm in unfamiliar territory.

Cheers,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: SQL Server Performance monitoring

2023-07-30 Thread Greg Keogh via ozdotnet
My finger of suspicion is pointing at SQL because the links are: An ASP.NET
Web Forms at the top -> which calls a Windows Service in the middle ->
which runs the SQL queries at the bottom. Both the app and service are
rather "thin" and have a good track record for the last 15 years, which
leaves the suspect. I did see some SQL timeout exceptions in the service
log.

However, spying on the GC is a good idea anyway. I'll do a practice run to
remember how it works, so when they next report a slow-down I can hop in
and have a look.

*Greg*

On Mon, 31 Jul 2023 at 10:34, David Kean  wrote:

> How confident are you that it’s a SQL query? Unpredictable “stalls” smells
> like garbage collection, likely a Gen2 blocking. A dump during the stall or
> better ETL trace using PerfView will quickly rule that out.
>
>
>
> *From:* Dr Greg Low via ozdotnet 
> *Sent:* Monday, July 31, 2023 10:27 AM
> *To:* 'ozDotNet' 
> *Cc:* 'Greg Keogh' ; Greg Low 
> *Subject:* RE: SQL Server Performance monitoring
>
>
>
> Hi Greg,
>
>
>
> The performance trace procedures in SDU Tools have duration as one of the
> summaries provided.
>
>
>
> Duration is a curious one though. In so many cases, it's meaningless, yet
> it's the one that the Microsoft tooling often worries about most.
>
>
>
> For example, if you have a query that executes, and then the client takes
> forever to retrieve the rowset that was produced (e.g. by reading it a row
> at a time and doing other things in between each row), the duration shows
> the entire time. But it could be a very light query.
>
>
>
> In your case though, that might well help, particularly if you find
> queries with long durations, but few pages read. That means that the query
> can't get its work done for some reason. Whenever you have that, it's
> blocked waiting on something else.
>
>
>
> If you can catch it while it's blocked, even Activity Monitor in SSMS can
> show you what's at the head of a blocking chain. sp_whoisactive (from Adam
> Machanic) will do a better job of that again. But that only helps if you
> can catch it while it's happening. That's why tracing usually helps.
>
>
>
> The other thing I've done in the past, if it becomes very hard to find, is
> to just leave a proc running in the background that every 5, 10, or 20
> seconds, finds any process that's at the head of a blocking chain, and
> writes details of it out to a table. That's more work, but it shows clearly
> what the regular culprits are. The "Show Current Blocking" code in SDU
> Tools should provide an example to help get something like that going.
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile
>
> SQL Down Under | Web: https://sqldownunder.com | About Greg:
> https://about.me/greg.low
>
>
>
> *From:* Greg Keogh via ozdotnet 
> *Sent:* Monday, July 31, 2023 10:15 AM
> *To:* ozDotNet 
> *Cc:* Greg Keogh 
> *Subject:* SQL Server Performance monitoring
>
>
>
> Folks,
>
>
>
> We have a problem on a live server where web users experience occasional
> unpredictable "stalls". There are a few links in the chain where the
> problem could be, but based on some clues in logs, I suspect that it's the
> last link at the bottom of the chain ... SQL Server that's the source of
> the problem.
>
>
>
> But I need evidence. Is there some feature of SQL Server or perhaps some
> tool that can detect queries that are suspiciously long running? This is
> SQL Server full standard edition. I haven't had to poke deeply into SQL
> Server's machinery before, so I'm in unfamiliar territory.
>
>
>
> Cheers,
>
> *Greg Keogh*
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: SQL Server Performance monitoring [Update]

2023-08-03 Thread Greg Keogh via ozdotnet
Folks, TGIF and FYI -- some more detailed logging and feedback from office
staff has opened this performance problem can of worms further.

Last Monday my main suspect was SQL Server, but it might be innocent and is
actually a victim. Dozens of SQL timeout exceptions are logged, but they're
all over the place, even in trivial selects of a single row which would
happen in a blink. Office staff report unpredictable "slow-downs" in
different apps. Web app users are suffering random pauses as well, as we
can see them clicking buttons multiple times in frustration (thereby
causing other problems).

So this problem is system wide in an in-house computer centre. A meeting
with the hardware/network support guy revealed many links in the chain.
There are a dozen workstations, several servers, VMs, multiple networks and
routers, two high-speed external internet connections, NAS boxes, terminal
services, Sophos and Anitmalware running, etc. There are so many places to
investigate that we're all a bit befuddled at the moment and are looking
for angles to investigate. I'm only involved in the office apps, who are
probably innocent victims, but I'm in the loop to help if I can.

This reminds of the 80s again on mainframes, but finding performance
problems back then was reasonably straightforward because there weren't so
many parts of the clockwork to examine. These days it's like trying to
debug an atomic clock.


*Greg K*

>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

CPU profiling an MS unit test

2024-02-14 Thread Greg Keogh via ozdotnet
It's not Friday, but I can't find any way of running the CPU performance
profiler over a [TestMethod] in my unit test project.

Web searches produce no useful results, some hint that I can right-click a
test in the test explorer and pick Profile..., but I have no such menu.

Is this possible or not? If so, what's the trick?

P.S. I often use the profiler for commands or GUI apps, but in that case
you set breakpoint #1 and start the profiler, then at breakpoint #2 you
stop it and collect the results. That doesn't work for a unit test method
(so far...).

*Greg*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: CPU profiling an MS unit test

2024-02-22 Thread Greg Keogh via ozdotnet
Nah. When you click start, it starts whichever project is set to Start,
which in my case was some WinForms old test project of no use. You can't
set a library to start.

I created a mini test project which did some CPU and IO work. If I start
the profiler it starts and waits, and when I run a unit test method it
reports nothing useful, just a [System Code] execution. In release mode the
profile just starts and stops while I've done nothing. All I can get is:

[image: image.png]

I'll wager that Chat GPT is smarter than me, so there's probably a way of
profiling a unit test, but my feeble biased human brain can't find it yet.
If it is possible and I can't find it, then the VS team needs to have a
chat to Chat GPT and ask it how to improve discoverability.

*Greg K*


> In the Performance Profiler, several profiling options are available, such
> as CPU Usage, Memory Usage, etc. For CPU performance, ensure CPU Usage is
> checked.
> Click Start.
> Run the Specific Test:
>
> The profiler will start, and Visual Studio will switch to a profiling
> mode. Now, navigate to the Test Explorer.
> Find the [TestMethod] you want to profile.
> Right-click on the test method and select Run. If your test project
> contains multiple tests and you only want to profile a specific one, make
> sure only that test is set to run.
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Web app large uploads and downloads

2024-01-02 Thread Greg Keogh via ozdotnet
Folks (welcome to the distant future of 2024)

I'm pretty sure that there is no sensible way to provide a bulk Azure Blob
upload facility in a web hosted app (Wasm, JS or whatever). There could be
thousands of files with a total size up to hundreds of MB. Managers are
currently using a WPF program I created for uploads and it feels like a
perfectly natural process on the desktop, and it's pretty fast using
streams on multi cores (I also optionally check for new or changed so only
*diffs* are uploaded which often saves a lot of time).

None of the components or controls I've seen are designed for huge uploads,
and in any case, I've reported that it's technically and usability
questionable to have "normal" users of the browser app doing this sort of
thing. The boss of the app suite is now considering the bigger picture and
the bulk upload feature may be delayed or moved to somewhere else in the
flow, or the desktop program will suffice. So I'm happy the issue is
on-hold for now.

I think this is a good example of how the web browser should never have
evolved into a host for business apps. I think the web browser, HTML, HTTP,
REST, css and JS have diseased 21st century IT.


*Greg K*

>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Web app large uploads and downloads

2023-12-29 Thread Greg Keogh via ozdotnet
Folks (anyone working?)

I've been asked to add a feature to a Blazor Webassembly app to allow
uploads and downloads of possibly large numbers of files between the local
file system and Blob storage. I'm not sure how to implement this feature in
a browser hosted app.

I wrote a WPF tool for "managers" which does high-performance bulk uploads
and downloads with nice progress (the code is trivial on the desktop), but
now they want the same feature for "normal" users in the Blazor app. Given
how dumb and restricted browser hosted apps are, I don't know how to code
this, or if it's even feasible.

Are there some tools, techniques or tricks I can apply? Any ideas or
suggestions anyone?

Thanks,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Web app large uploads and downloads

2024-01-02 Thread Greg Keogh via ozdotnet
I think it's been using azcopy for a fair while now. Azcopy has improved
dramatically over the last few years to have more switches and options. I
recently used it to bulk copy a container in one storage account to
another, then bulk upload all files with certain extensions (which wasn't
originally possible). In each case it was harder than refining fissionable
uranium, so I pasted the skeletons of the working commands into my "bag of
tricks" text file. The Blazor bulk upload is mercifully on hold while they
reconsider who should have the facility -- *Greg K*

On Wed, 3 Jan 2024 at 16:27, Dr Greg Low via ozdotnet 
wrote:

> I notice that the Azure Storage Explorer desktop app nowadays defaults to
> using azcopy under the covers to copy files. That’s a much better option
> for files of any size. Probably need a component that does that but azcopy
> has a few dependencies.
>
>
>
> It’s on GitHub as open source so you could probably check out how it does
> what it does. It’s sure fast and filesize isn’t an issue. I’ve used azcopy
> on multi-terabyte files without issue. (Apart from the hosting provider for
> the site calling to find out what was going on, given the way it worked in
> parallel and flooded their network)
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile
>
> SQL Down Under | Web: https://sqldownunder.com
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__sqldownunder.com_=DwMFAg=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=2rgtwrXggQFZiZbisdwDooYFalucb-vLhjG0McaanBZKn0UVuognuHqfHnjp2AVc=I23jyX4AKIv9q2x7A3CQAer9PGCjq8R6DwW7BE1IAhZ1JbigKMrMPRCjs6AqW7h3=o3oFliHztOF8D9Nbqaa7KQdqC-zkQNXWl4IqnEG58Wc=>
>  |
> About Greg:  https://about.me/greg.low
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__about.me_greg.low=DwMFAg=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=2rgtwrXggQFZiZbisdwDooYFalucb-vLhjG0McaanBZKn0UVuognuHqfHnjp2AVc=I23jyX4AKIv9q2x7A3CQAer9PGCjq8R6DwW7BE1IAhZ1JbigKMrMPRCjs6AqW7h3=NsAibgiqfCxsyc8m2DBKogKQcs3OqE3mkyCjmpoYxTk=>
>
>
>
> *From:* DotNet Dude via ozdotnet 
> *Sent:* Wednesday, January 3, 2024 4:17 PM
> *To:* ozDotNet 
> *Cc:* DotNet Dude 
> *Subject:* Re: Web app large uploads and downloads
>
>
>
> Yep we usually do this sort of thing with a batch process, particularly if
> there are large files. I don’t see any web app being used just to upload a
> bunch of files.
>
>
>
> For fun try asking ChatGPT or one of the others to see where they go.
>
>
>
> On Wed, 3 Jan 2024 at 11:13, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote:
>
> Folks (welcome to the distant future of 2024)
>
>
>
> I'm pretty sure that there is no sensible way to provide a bulk Azure Blob
> upload facility in a web hosted app (Wasm, JS or whatever). There could be
> thousands of files with a total size up to hundreds of MB. Managers are
> currently using a WPF program I created for uploads and it feels like a
> perfectly natural process on the desktop, and it's pretty fast using
> streams on multi cores (I also optionally check for new or changed so only
> *diffs* are uploaded which often saves a lot of time).
>
>
>
> None of the components or controls I've seen are designed for huge
> uploads, and in any case, I've reported that it's technically and usability
> questionable to have "normal" users of the browser app doing this sort of
> thing. The boss of the app suite is now considering the bigger picture and
> the bulk upload feature may be delayed or moved to somewhere else in the
> flow, or the desktop program will suffice. So I'm happy the issue is
> on-hold for now.
>
>
>
> I think this is a good example of how the web browser should never have
> evolved into a host for business apps. I think the web browser, HTML, HTTP,
> REST, css and JS have diseased 21st century IT.
>
>
>
> *Greg K*
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Private Apple App distribution

2024-01-17 Thread Greg Keogh via ozdotnet
>
> Perhaps not ideal but maybe the app can go into the app store but nobody
> can actually use it without an account which you would only allow your
> users to create. Just an idea.
>

Each phone running the app needs its app-generated ID registered in a
master XML file, so the public can't run it, which makes forcing it into
the store somewhat stupid -- *Greg*


>
>
> On Wed, 17 Jan 2024 at 14:48, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote:
>
>> Folks,
>>
>> We're planning a MAUI app to be installed on company Android and Apple
>> phones. For Android I can just generate the APK file and side-load it
>> (after the security settings are relaxed). I don't know how to do the same
>> for iPhones. We don't want the app in the store. Assuming there is a
>> convention for "side-loading" Apple apps, what's the technique? Is anyone
>> doing this?
>>
>> A few years ago we published a Xamarin app, but it was for the public and
>> was published in both stores. This time the app's private to the company.
>>
>> Thanks,
>> *Greg Keogh*
>> --
>> ozdotnet mailing list
>> To manage your subscription, access archives:
>> https://codify.mailman3.com/
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Blazor css overrides

2023-11-30 Thread Greg Keogh via ozdotnet
Folks, TGIF

Our Blazor app has a simple classic shape with a local wwwroot/app.css file
containing all the styles for the app. I had to allow people to customise
the appearance, and my way of doing that works, but not as smoothly as I
hoped and I think someone might be able to suggest a better more elegant
technique.

If someone starts the app with query parameter ?t=contoso then the startup
code appends a line like this into the 

https://*somecompany*.
blob.core.windows.net/*myapp*/*contoso.css*">

They can edit this external css file and override selectors without
touching the original app's files. Firstly ... is this sensible? It works,
but there is a problem.

To override a certain colour they have to code something like this:

.HeadLinkSel { background-color: BlueViolet !important; }

Note how the !important is needed, sometimes. I can't figure out why yet,
but !important needs to be added to the overrides most of the time. I
thought that the last selector override all previous identical ones, and
it's really irritating and confuses people settings the overrides. Can
anyone explain this?

Maybe my whole technique is flawed and naïve. I'm keen for suggestions or
links to recommended techniques for doing this sort of thing.

Cheers,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Conditional builds of arbitrary files

2023-12-04 Thread Greg Keogh via ozdotnet
Folks, the MSBuild process provides Condition= and #if to provide lots of
control over which files and code fragments are compiled and published for
a given Configuration.

My projects contain increasing numbers of non-cs files like html, css, js,
txt, etc which often need conditional processing, especially the equivalent
of a #if to select fragments of those sorts of files for different
configurations. There's no way to select fragments of arbitrary files with
a #if, so I've been wondering for years about the best way to simulate the
feature.

I can't find any tools to do this, so I *think* that a custom MSBuild Task
might be the way to go. The task could be given some parameters and it
would edit the files and add and remove sections based upon the
configuration before the build starts.

Does anyone think that's a good idea? Or maybe there's a better way.

Cheers,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Conditional builds of arbitrary files

2023-12-04 Thread Greg Keogh via ozdotnet
>
> Look at VS Text Templates, or we sometimes make use the C-preprocessor.
>

Bingo! I'm a big fan of T4 templates and have used them in anger in many
projects ... but I didn't think of using them in this case. I just did a
sanity check and it works. Thankfully someone published an example of how
to get the active configuration value inside the tt file (in brief).

<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDTE" #>
<#@ import namespace="System" #>
<#@ import namespace="EnvDTE" #>
<#@ output extension=".html" #>
<#
var serviceProvider = Host as IServiceProvider;
var dte = serviceProvider.GetService(typeof(DTE)) as DTE;
var configName = dte.Solution.SolutionBuild.ActiveConfiguration.Name;
#>
 ... (etc)

With the config value I can now <# if #> control the contents of the html
file. It looks a bit strange in the VS solution tree, but so what, it works.

There is one quirk ... the T4 generator does not run automatically when the
configuration changes or when you build or publish, so I must remember to
Alt+B+4 as needed.

Thanks,
*Greg*

P.S. If I see you at DDD I'll shout you a drink as thanks.


>
> *From:* Greg Keogh via ozdotnet 
> *Sent:* Tuesday, December 5, 2023 11:59 AM
> *To:* ozDotNet 
> *Cc:* Greg Keogh 
> *Subject:* Conditional builds of arbitrary files
>
>
>
> Folks, the MSBuild process provides Condition= and #if to provide lots of
> control over which files and code fragments are compiled and published for
> a given Configuration.
>
>
>
> My projects contain increasing numbers of non-cs files like html, css, js,
> txt, etc which often need conditional processing, especially the equivalent
> of a #if to select fragments of those sorts of files for different
> configurations. There's no way to select fragments of arbitrary files with
> a #if, so I've been wondering for years about the best way to simulate the
> feature.
>
>
>
> I can't find any tools to do this, so I *think* that a custom MSBuild
> Task might be the way to go. The task could be given some parameters and it
> would edit the files and add and remove sections based upon the
> configuration before the build starts.
>
>
>
> Does anyone think that's a good idea? Or maybe there's a better way.
>
>
>
> Cheers,
>
> *Greg Keogh*
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Blazor css overrides

2023-12-03 Thread Greg Keogh via ozdotnet
>
> I recall doing something similar in the past but I believe I gave each
> client their own entire css. So app.css by default OR use the client’s css
> if the config value is passed (via querystring or whatever).
>

I was thinking of that as the best choice. If t=company is specified then
I'll insert a link to a complete css file in their storage, falling back to
a local app.css. They have complete control of the styling that way.
EXCEPT... if we invent new styles, which is quite possible, foreign copies
will need to be synchronised, which is fragile. Maybe not the best choice
after all.

I don’t see a problem with using !important if it guarantees it and they do
> it always. If they don’t want to then the alternative above may suit.
>

Articles tell you to never use !important in public shared css files, but
since the customer's overrides are the top of the food chain, then maybe
it's acceptable.


> I’ve never bothered going down the rabbit hole of css to be honest.
>

That's putting it politely. If I bothered to learn all about css then it
would certainly displace other knowledge from my brain that is more
valuable.

*Greg*


>
>
> On Fri, 1 Dec 2023 at 15:53, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote:
>
>> Folks, TGIF
>>
>> Our Blazor app has a simple classic shape with a local wwwroot/app.css
>> file containing all the styles for the app. I had to allow people to
>> customise the appearance, and my way of doing that works, but not as
>> smoothly as I hoped and I think someone might be able to suggest a better
>> more elegant technique.
>>
>> If someone starts the app with query parameter ?t=contoso then the
>> startup code appends a line like this into the 
>>
>> https://*somecompany*.
>> blob.core.windows.net/*myapp*/*contoso.css*">
>>
>> They can edit this external css file and override selectors without
>> touching the original app's files. Firstly ... is this sensible? It works,
>> but there is a problem.
>>
>> To override a certain colour they have to code something like this:
>>
>> .HeadLinkSel { background-color: BlueViolet !important; }
>>
>> Note how the !important is needed, sometimes. I can't figure out why
>> yet, but !important needs to be added to the overrides most of the time. I
>> thought that the last selector override all previous identical ones, and
>> it's really irritating and confuses people settings the overrides. Can
>> anyone explain this?
>>
>> Maybe my whole technique is flawed and naïve. I'm keen for suggestions or
>> links to recommended techniques for doing this sort of thing.
>>
>> Cheers,
>> *Greg Keogh*
>> --
>> ozdotnet mailing list
>> To manage your subscription, access archives:
>> https://codify.mailman3.com/
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Private Apple App distribution

2024-01-16 Thread Greg Keogh via ozdotnet
Folks,

We're planning a MAUI app to be installed on company Android and Apple
phones. For Android I can just generate the APK file and side-load it
(after the security settings are relaxed). I don't know how to do the same
for iPhones. We don't want the app in the store. Assuming there is a
convention for "side-loading" Apple apps, what's the technique? Is anyone
doing this?

A few years ago we published a Xamarin app, but it was for the public and
was published in both stores. This time the app's private to the company.

Thanks,
*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Private Apple App distribution

2024-01-16 Thread Greg Keogh via ozdotnet
So you're all telling me that there is no "side load" feature for iPhone
apps?! This is a dreadful obstacle to getting the app onto company staff
phones. Luckily I have an Apple account that was recently renewed (for 150
goddamn $), but I'll have to fill-in all the store compliance documentation
and make keys and fumble through their cryptic alien processes, and so on
and on. Goddammit again.

*GK*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

[OT] Windows Server install problems

2024-03-15 Thread Greg Keogh via ozdotnet
Folks, it's been a non-TGIF day. My old server under the desk running
Server 2019 (or 2016 I forget) died this morning and I'm trying to create a
replacement

I have a brand new *one of these*
,
so I installed Server 2019 and it all went smoothly until it booted and all
chipset devices are dead, including the network adapter and the screen is
stuck at SGA. The only drivers I can find are for Windows 7 to 11 and
nothing else.

I tried installing 2016 as an experiment but it produces the same results.

Am I wasting my time? Is that box incapable of running recent Windows
Server editions?

*Thanks, Greg*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Windows Server install problems

2024-03-16 Thread Greg Keogh via ozdotnet
>
> They took a lot of device support out of server along the way and that is
> when I stopped running it in my laptop. I'd install windows 11 and turn on
> hyper v and run server in a vm
>

I guess this means I must shop around for a hardware combination (or a
whole box) that specifically runs the latest Windows servers. The price of
that is worrying, and I need do the research. I've been lucky for the last
20 years because old work PCs could be rebranded as home servers without
any hiccups at all -- *Greg*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Windows Server install problems

2024-03-16 Thread Greg Keogh via ozdotnet
>
> Just put the server in a vm on win11. All your problems will go away.
>

Okay, a consensus from such distinguished persons. I'm reconsidering my way
forward -- *Greg K*


> David Connors
> da...@connors.com // +61 417 189 363
>
>
> On Sun, 17 Mar 2024 at 10:17 am, Greg Keogh via ozdotnet <
> ozdotnet@ozdotnet.com> wrote:
>
>> They took a lot of device support out of server along the way and that is
>>> when I stopped running it in my laptop. I'd install windows 11 and turn on
>>> hyper v and run server in a vm
>>>
>>
>> I guess this means I must shop around for a hardware combination (or a
>> whole box) that specifically runs the latest Windows servers. The price of
>> that is worrying, and I need do the research. I've been lucky for the last
>> 20 years because old work PCs could be rebranded as home servers without
>> any hiccups at all -- *Greg*
>> --
>> ozdotnet mailing list
>> To manage your subscription, access archives:
>> https://codify.mailman3.com/
>
> --
> ozdotnet mailing list
> To manage your subscription, access archives: https://codify.mailman3.com/
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Active Directory lookup

2024-05-23 Thread Greg Keogh via ozdotnet
TGIF!

I just spiced-up an ASP.NET app so that it uses DirectorySearch.FindOne

to either verify a login user account exists or to authenticate. It runs
perfectly on my work PC, but when I installed the app in IIS on my test
server it died with *The specified domain either does not exist or could
not be contacted*. I discovered that because my app was running as NETWORK
SERVICE, which isn't a domain user, it can't see the Active Directory.

A trap...only domain user accounts can *see* AD. Asking the customer (a
hospital) to create a special account, assign it to the pool and set ACLs
is impractical. My lovely new login feature has hit a roadblock and I'm not
sure of a workaround or alternative. It's a specialist topic, but I thought
I'd ask in here just in case some boffin has suggestions.

*Greg Keogh*

P.S. I just remembered that about 15 years ago I used a Win32 Interop to
call LoginUser

for a similar purpose, but it was for local accounts and I'll need to
research if it works for domain accounts.
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Active Directory lookup

2024-05-23 Thread Greg Keogh via ozdotnet
I have found the answer. I record it here in case it helps someone in the
future.

While avoiding AD, if you simply want to check if an account exists either
locally or in the default domain do this:

uint sidSize = 0;
uint domainSize = 0;
int accountType = 0;
bool b1 = LookupAccountName
(null,
user, null, ref sidSize, null, ref domainSize, ref accountType);
int err2 = Marshal.GetLastWin32Error();
if (err2 == 0x007a) { *the account exists (insufficient buffer)* }
else if (err2 == 0x0534) { *account not found (no mapping)* }
else { *some bad error code* }

If you want to authenicate an account credentials then call LoginUser
,
there are lots of examples.

*Greg*

On Fri, 24 May 2024 at 09:06, Greg Keogh  wrote:

> TGIF!
>
> I just spiced-up an ASP.NET app so that it uses DirectorySearch.FindOne
> 
> to either verify a login user account exists or to authenticate. It runs
> perfectly on my work PC, but when I installed the app in IIS on my test
> server it died with *The specified domain either does not exist or could
> not be contacted*. I discovered that because my app was running as
> NETWORK SERVICE, which isn't a domain user, it can't see the Active
> Directory.
>
> A trap...only domain user accounts can *see* AD. Asking the customer (a
> hospital) to create a special account, assign it to the pool and set ACLs
> is impractical. My lovely new login feature has hit a roadblock and I'm not
> sure of a workaround or alternative. It's a specialist topic, but I thought
> I'd ask in here just in case some boffin has suggestions.
>
> *Greg Keogh*
>
> P.S. I just remembered that about 15 years ago I used a Win32 Interop to
> call LoginUser
> 
> for a similar purpose, but it was for local accounts and I'll need to
> research if it works for domain accounts.
>
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Customisable web app styling

2024-06-17 Thread Greg Keogh via ozdotnet
Folks, I'm trying to find the "best" way of allowing different customers to
style their own hosted version of our web app (actually a Blazor net8.0
app). For years we hosted a single global copy of the app in our Azure
subscription where multiple customers would use it. It has a single line
for the app's styles:



When customers deploy the app in their own subscriptions it would be great
to leave the default app.css file untouched but allow them to easily
override any style elements they like. What's the best way of doing that?
Do I simply append a line like:



Do styles in that link override any identical ones in the previous one? I'm
not sure of the cascade order or conventions. There might be better
techniques I'm not aware of.

Thanks,
*Greg K*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/