Tuesday, November 15, 2022

CSharp Interop P/Invoke mechanism has change in .NET7 - LibraryImport replaces DLLImport

Major announcement at .NET CONF 2022 .NET7 which some of you many have missed,  replaces DLLImport() with LibraryImport(). 

Official documentation here - 
Use custom marshallers in source-generated P/Invokes | Microsoft Learn

Sampe Pseudo Code

// Import user32.dll (containing the function we need) and define
// the method corresponding to the native function.

[DllImport("user32.dll", EntryPoint = "MessageBoxW", CharSet = CharSet.Unicode, SetLastError = true)]

private static extern int MessageBoxW(IntPtr hWnd, wstring lpText, string lpCaption, uint uType);

//>>>>>>>>>>>> .NET7 New P/Invoke Method <<<<<<<<<<<<
[LibraryImport("user32.dll", EntryPoint = "MessageBoxW", SetLastError =true,
StringMarshalling = StringMarshalling.Utf16)]

internal static partial int MessageBoxW(IntPtr hWnd, string lpText, string lpCaption, uint uType);

Differences from DllImport

LibraryImportAttribute is intended to be a straightforward conversion from DllImportAttribute in most cases, but there are some intentional changes:

There are also differences in support for some settings on MarshalAsAttribute, default marshalling of certain types, and other interop-related attributes. For more details, see our documentation on compatibility differences.

.NET CONF 2022 Video Release

Monday, November 14, 2022

Fedex phishing email with subject Re: FEDEX

For the record, this is a Fedex phishing email attempt that is recently going around, with subject RE: Fedex

What to do?  Report them, goto bottom of page. 

From : Shipment Trackings <hetaarbetare.utskick@brandskyddsforeningen.se>
Subject : RE: FEDEX




How to tell this is a Phishing email ?

  1. Check email address in full, if it's not from originating company then it's phishing.
  2. Hover over all links in email, if it's not from the  company's website then forget it.
  3. The best way is to 

How to examine Email Message Source ?

Now lets look at message source
  1. Outlook.com->Actions->View Message Source. 
  2. Gmail.com->More (down arrow to top right)->Show original.
Check for suspicious links, anything that does not originate from apple.com.

Report Phishing Email (not as Spam)

  1. Outlook.com->Junk (at Top)->Phishing Scam
  2. Gmail.com->More (down-arrow to top right)->Report Phishing 

Report Phishing

If you have received this email take it further at 

  1. https://www.google.com/safebrowsing/report_phish/

Report phishing at Microsoft and subsequently government agencies

  1. http://www.microsoft.com/security/online-privacy/phishing-faq.aspx
  2. Report Phishing Sites | CISA
  3. Home - Canada's Anti-Spam Legislation (fightspam.gc.ca)

Sunday, November 13, 2022

How do developers generate revenues - State of Nation Report from SlashData

How developers generate revenues

  • Contracted development is the revenue model of choice across all industry verticals, used by nearly a third (31%) of professional developers.
  • Less than one in ten (7%) professional developers are generating revenue from selling data.
  • Usage of the advertising revenue model declines as companies grow in size.
  • Developers working for large enterprises (5K+ employees) tend to use
    multiple revenue models less often than developers in smaller companies.

Below we have included a few graphs that illustrate some of the findings.

You can download the full report for free and access all data and insights within.

If you need additional information or looking to understand developer preferences’, please get in touch with us and we will dive into it together.

    Full Article :  https://www.slashdata.co/blog/state-of-the-developer-nation-coding-language-popularity-chinas-developer-market-how-developers-make-revenue-and-more