Nuget and .NET Standard

I just pushed out my first production ready library, RandomSelection, to NuGet.  I’ve been meaning to publish it for over a year but never got around to it.  I honestly thought the process was going to be more involved but it was pretty simple.  The library was original written in .NET 4.X but before I published it I wanted to move it over to .NET Standard.  The motivation was to enable its use across a wider range of projects.  To make the change I followed three steps.

First, created a new project in Visual Studio 2019 targeting the .NET Standard Library project template.

Second, copied over the classes and project structure from the original project over to the new one.

Third, updated my tests since the library I was using had made a change that impacted my code.  Also made small updates to the way I was throwing exceptions so that the message received by the caller would be clear.

That was it.  Then to build the NuGet package I used the VS 2019 project properties view to set the parameter values used by NuGet.  For a detailed set of instructions to follow take a look at Microsoft’s Create and publish a package using Visual Studio.  No need to create your own nuspec file or sign it.  Give it a shot.  It was amazingly easy.

Regex String Replace Rescue

I ran into an issue recently where I needed to fix two fields in a SQL statement.  Wasn’t a big deal except there were over 8,000 SQL statements requiring the change.  Would have loved to do a simple Replace String in Notepad++ but each value was unique.  The job that needed to be done was change a value from a string with single quotes around it to be a decimal number.  Simple enough, a value like ‘12.34’ needs to be come 12.34 for the SQL statement to be valid.

Anytime I working with random text files I tend to work in Notepad++.  I like the user experience it presents, it is light-weight, and fast.  Within the application you can perform the standard search and replace or you can use regular expressions to search the file.  I knew my search would have to involve regular expressions but what I wasn’t sure was whether I could replace the text with the cleaned version of itself.  To my surprise, and due to regex ignorance, this was 100% possible.  By taking advantage of a feature called Capture Groups a user can specify a search pattern as well as the specific part of the pattern you want to keep.  Then, for the replace value in the search and replace window you set the replacement value as \1 which represents the first, and in my case only, capture group.

Notepad++ Regular expression string replace

What this all came down to was using the regular expression ‘(d\d\.d\d\)’ created a search term that looked for a two digit number with a decimal and two more digits after the decimal surrounded by single quotes.  The digits and decimal will be saved as part of capture group one.  Now I know there were probably much better ways to create a regex search term but this worked so I went with it.  Thank you to StackOverflow for getting me squared away with this problem.

Developer Podcasts

Back in 2013 I changed from developing embedded systems in Linux with Java and C++ to developing enterprise applications on Microsoft Windows in .NET.  The new development stack turned me into a fish out of water looking for some direction.  I had 30 to 40 minute commute to work so I looked to fill it with podcasts that could give that direction.  Over the the last few years I’ve narrowed them down to a half dozen that I subscribe to and recommend to other developers.


One thing I can’t recommend enough is to explore areas outside of your core area of interest.  Broaden your knowledge with podcasts like American History which go out and have a different lecture from across American universities each week.

Don’t forget to remove the end forward slash when enabling CORS

You ever run into an issue with your code, spend way to long looking at it and not get anywhere?  Especially one that you’ve solved before but having a lapse in memory.  That was me all too recently.  I was setting up an app that consisted of three projects in a solution.  One project for the API, one for the DTO, and another for the MVC.  The problem with this setup is that any Javascript call from the MVC project to the API will be blocked when the data comes back due to the browser enforcing same-origin policy.  Microsoft has a great write-up on how to Enable CORS within an ASP.NET Web API 2 project.  For your own sanity please make sure you go the whole through section.  I mean, the whole thing, all the way to the end, because at the end of the section is a rather important fact.  When you are defining the EnableCors attribute on the API controller you need to make sure that the forward slash at the end of the origins parameter is removed.

Good: [EnableCors(origins: "http://localhost:49332", headers:"*", methods:"*")]

Bad: [EnableCors(origins: "http://localhost:49332/", headers:"*", methods:"*")]

That is it.  That single forward slash tripped me up.  The error written to the web DevTools console was
Access to XMLHttpRequest at 'http://localhost:49342/api/users/name/smith/' from origin 'http://localhost:49332' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Hope this helps you waste a little less time.

Generating Entity Framework classes for Database First project

Not all projects, or development teams, use Code First with Entity Framework for building and maintaining their database.  There are plenty of reasons for doing it either way but that discussion is outside of the scope of this post.  What this post is going to focus on is generating your EF classes in a Database First environment.

Microsoft has plenty of great documentation for developers and one such post that I used recently was Getting Started with EF Core on ASP.NET Core with an Existing Database.  My setup is Visual Studio 2017 Community Edition and a .NET Core 2.1 project structure.  The database is running on a free, local instance of SQL Server 2017 and consists of a handful of tables.  To generate the classes I utilized the Package Manager Console (PMC) in Visual Studio and the Scaffold-DbContext command.

Scaffold-DbContext "Data Source=localhost\SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=True;" Microsoft.EntityFrameworkCore.SqlServer -outputDir Repository -Verbose

The connection string is pretty basic.  I’m telling it to connect to a database on my machine called MyDatabase and use my Windows Credentials for authentication.  The files generated should go into the directory called Repository in my project.  And for help with debugging any problems I include the -Verbose parameter.

Upon completion all generated files were open in my VS instance for inspection and located in the folder I set as the output destination.  If this didn’t happend and you have an error message make sure that your project builds on its own.  If the project doesn’t build then the Scaffold-DbContext won’t be able to generate the files.  One thing to check before you submit your code to any repository is that in your Context.cs class the connection string used for Scaffold-DbContext is hard-coded into the file.  If the code is going to a public repository you’ll want to make sure this line is removed.

Using AdMobFree plugin with Ionic 3

Recently I updated one of my applications to use the Cordova Plugin AdMobFree to show advertisements in my Ionic app to generate revenue. There are several plugins available to Ionic developers to use for showing ads from AdMob but this one provided the core features I needed without a bunch of bells and whistles I didn’t. This post will go over the steps I took in order to get the plugin to work in my project. If you run into any issues let me know and I’ll see if I missed a step.

To start, let me be clear that this is geared to projects developed utilizing the Ionic 3 framework. It should work for Ionic 2 applications as well but I would not base an Ionic 4 application off of this code given all the changes that have been made for that framework.


$ ionic cordova plugin add cordova-plugin-admob-free --save --variable ADMOB_APP_ID="<YOUR_ADMOB_APP_ID_AS_FOUND_IN_ADMOB>"
$npm install --save @ionic-native/admob-free@4

Make sure you include your APP ID from AdMob. You can get the value by going to AdMob then clicking on the application under Apps and going to App Settings.

In your config.xml file you should see a section for cordova-plugin-admob-free that has the ADMOB_APP_ID variable defined with the value you passed in during the installation. If not then run the remove command for the plugin and try adding it again.  

One thing worth remembering is that if you run into build issues where errors are reported about the Android version or support libraries used then you’ll want to install the Cordova Android Support Gradle Release npm package.  

When it comes to installing your Android platform I recommend installing version 6.3.0. 

$ ionic cordova platform add android@6.3.0

With that you should have all of the packages and configuration completed.  It is now time to dive into the code.


The first changes to your code have to be made in the app.modules.ts file.  You’ll need to import the plugin and add it to the providers section.

import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';

declarations: [...],
imports: [...],
bootstrap: [...],
entryComponents: [...],
providers: [...

On the page you want to show the ads you’ll only need to make changes to the underlying TypeScript file.  You’ll first want to import the necessary packages.

import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
In the constructor include the AdMobFree declaration.  
    private admob:  AdMobFree) {}
private createBanner() {
let logger:LoggingProvider=this.logProvider;

try {
let bannerConfig:any= {
id: <android banner id>,
autoShow: true,
isTesting: true

.then(() => {
//We have a banner :)
}).catch((error) => {
// Handle the error case
catch (exception) {
// Something bad happened

And that is it.  You should have a basic banner displaying on the application.  Once you are ready to go to production you’ll want to change the isTesting parameter to false so real advertisements come through.

If you want to give the option for your users to go advertisement free there is an easy method call to remove the banner.


When I get some time I’ll try to put up an example project or put in a pull request for a demo on the AdMobFree repo.  Until then, let me know if I missed anything and I’ll update the instructions.

Divide by Zero

You know what might ease tensions? If everyone took a break from political shows, web sites, radio, and news for a while. Take the soap opera drama that passes as news and just detox for a good few days, weeks, months, or years. Maybe the superficial hate will dissappear. Maybe the imaginary lines that have been drawn will fade away. Because if not this constant division will get to the point where you can’t divide society any further. That is when you divide by zero and everything falls apart.

A Break from Facebook

This past June I took some time off from Facebook.  The site was consuming too much time and always made me feel a bit empty after using it.  So, from June through most of August I was Facebook free.  I’d say it was nice but it wasn’t…the time off was GREAT!

I have no idea how much time I was able to get back but it had to be several hours a week.  And I honestly felt happier than before.  Now I will admit that I have Instagram and when I suspended my Facebook account I started spending a bit more time there, which is also owned by Facebook, but the draw to be on the app was far less.  Instead of checking multiple times a day I’d check once or twice every few days.  And when I was on Instagram the amount of time didn’t even compare to Facebook since I was only browsing photos of friends or organizations I followed and the numbers I follow are far less than the “Friends” I have on Facebook.

But, like so many other good things, the break came to an end.  The choice to reactivate the account was actually uncomfortable because I was afraid I’d go back to wasting time on the site.  The reason for re-activating was simple, my coworkers all message, trade and sell things, and setup work events through Facebook so if I wanted to be apart of the group I’d have to rejoin the social network.  I’m hoping that this will only be a temporary affair or that I’ll use the site sparingly now that I know how nice it is without it.  I hope…but if the hope doesn’t pan out then I may just need to suspend the account again.

Give it a try.  Try suspending your account for a few days, weeks, or months.  See what life is like without it.  You can still use the Messenger app with your account suspended.  And if you have any apps or sites that you login with your Facebook account you can do a “Forgot my password” option and just provide the email address you use for Facebook to get a temporary password.  Go ahead, see what life is like outside the blue of Facebook.

ion-toggle Toggle/Change event handling

I’m working on an Ionic v2+ app that requires some extra logic to be executed when a toggle switch, also known as a radio button, is changed.  In Ionic this component is called an ion-toggle.  I tried using the normal decorators like (change) or (click) but none of them were firing.  What I didn’t realize, mainly because I didn’t see it in the Ionic documents was that in order to handle changes in the state I needed to use the (ionChange) decorator on the component.  With this I could pass in more details to the function being executed.

<ion-toggle id="toggle{{}}{{}}"
     (ionChange)="onChildSelection(,, child.selected)">
 In the above example the id of the component is being set to include the name of the parent and child.  The state is based on the child.selected state which in this case is a boolean value.

Philadelphia Region Tech Employers

One of the hard things when looking for a job is getting a good listing of companies that hire in your field. Over the years I’ve kept track of companies that have posted jobs related to software development or developer operations in the Philadelphia, Pennsylvania region. There are a few that are more north in the Lehigh Valley region but I didn’t take them out as they are all within commuting distance. Hopefully this helps out fellow technologists find the next step in their careers in southeast Pennsylvania.

Last updated 01 July 2019

– 3Gtms
– Accolade, Inc
– Acurian
– Alion Science and Technology
– Allied Wire & Cable
– Almac
– Alphapoint
– Amdocs
– AmerisourceBergen
– Arrowroot Capital
– AWeber
– Azavea
– Bainbridge Health
– Benefits Data Trust
– Bentley Systems
– Betterment
– Blackfynn
– Blackrock
– Blue Cadet
– Boeing
– Bolt On Technology
– Brio Solutions
– Brooks Instruments
– Cadent
– CardConnect
– CDM Smith
– Cerner
– Chariot Solutions
– CHI Systems
– Cloudreach
– Cobham plc
– Comcast
– Converge Consulting
– CreativeMMS
– Creedence Solutions Inc
– Curalate
– Dell
– Dick’s Sporting Goods
– Dorman Products
– Drama Fever
– Drexel University Libraries
– Elsevier
– Elsevier
– eMoney Advisor
– EmployVision
– empowr
– EPAM Systems
– Equisoft
– Evantage Technologies Inc
– Evolve IP
– Express Scripts
– Freedom Pay
– Frontage Laboratories
– GlaxoSmithKline
– goPuff
– Greystones Group
– Grubhub
– Guru
– HealthJump
– Healthverity
– HomeNet Auto
– Honeywell
– ICON plc
– Inspire
– Integrity Applications Incorporated
– Interactive Mechanics
– Invata Intralogistics
– JOOR Engineering
– Kenexa (IBM)
– Kepler Group
– KL Discovery
– Kulicke & Soffa
– LifeShield
– Linode
– Lockheed Martin
– Lutron
– McKesson
– McNeil Consumer Healthcare
– MeetMe
– Merck
– Microsoft
– Mikros Systems
– Miles Technologies
– Molecular Devices
– Monetate
– Moven
– Music Choice
– Nartal Systems
– National Board of Medical Examiners
– NCC Automated Systems
– Neat
– Northrop Grumman
– NuCitrus Technologies
– Oracle
– ORS Partners
– Pariveda
– Penn Mutual
– PerPay
– Philadelphia Housing Authority
– Philadelphia Media Network
– Pinnacle 21
– PMA Companies
– Practice
– PracticeFusion
– Proconex
– Promptworks
– Pure Storage
– Push10
– QuantaVerse
– Red Tettemer
– RELX Group
– RevZilla
– Ring (Amazon)
– RJMetrics
– ROAR for good
– RS Energy Group
– s2s Communications
– Sabre Systems
– Sapient https://sapient.indistries
– Sapling Inc
– Sapvix
Scientific Search
– SEI Investment Company
– ShareTracker
– Sidecar
– Siemens
– Skyhook
– smithwise
– Stratus EMS
– Subaru of America
– Susquehanna International Group
– Syapse
– Syncro Medical
– Tabula Rasa HealthCare
– TechField
– Temenos
– The Meet Group
– Therapy Notes
– Think Company
– Tonic Design Co.
– trizic
– Turn5
– Tyndale USA
– Unisys
– Universal Health Services
– UPenn School of Medicine
– Vandegrift
– Vanguard
– Vertex
– VertMarkets
– Vistar Media
– Vitaver & Associates
– West Pharmaceutical Services
– Weather Trends International
– Weblinc
– We Buy Any Car
– Wildbit
– WipFli
– Wirecard
– YPrime

If you have any questions or suggestions leave a comment below.