dotNetDave Rocks India!

C6ZbZyBWMAAI7-l.jpg
The dotNetDave Rock The World Tour is finally headed to India! I’ve been wanting to rock India for many years. I’ll be speaking at the C# Corner Conference in Delhi on 7 – 9 April.

Have you been to India before? I’d like to hear about what to bring/ not to bring, do/ not do while I’m there. I won’t be there long so want to pack in as much learning about India as I can. Check out my article on C# Corner about my thoughts on this trip.

Below are the sessions I’ll be doing (more to be announced):

Rock Your .NET Core Best Practices

11:30am in WEB/DEV TRACK

In this sessions, you will learn how to apply .NET Framework best practices to .NET Core. There are a lot of changes and every developer needs to attend this session before moving to .NET Core. This is part 6 in my 6 part series titled “Improving Code Quality… One Developer At A Time”. (more info coming soon)

Please take my Coding Standards Survey before attending this session (you could win a free copy of my Rock Your Code DVD).

Rock Your Technical Interview

4:20pm in MOBILE/CLOUD TRACK

Have you ever not gotten a job because you weren’t prepared for the interview? Would you like a big raise? Do you need motivation to rock your career? I’ve interviewed 100’s of software developers and will share my knowledge on how to survive, what we look for and even divulge some of the secrets we use during the process. Whether you are looking for a new position within your company or at a new company you need to attend this session. Included are crazy and strange interview stories from engineers just like you! Learn tips to get you started, working with recruiters, getting prepared, the technical interview and more. You will also learn what is the #1 question you need to ask during an interview… it’s a game changer!

Rocking Your Technical Interview with David McCarter interview on dotNetRocks!

Here’s What People Are Saying About This Session

  • Chris S. – I wanted to thank you for your DVD on Technical Interviews. I attended your presentation at Desert Code Camp and purchased the DVD. Your guidance on how to handle technical and even non-technical questions gave me great support and confidence going into a round of interviews I had. That confidence translated into performance as I was able to receive attractive offers from multiple companies, and I was able to make an important move that has been a life-altering, exciting change for me.
  •  Bill W. – Good information! I had forgotten to study the technical questions, did that this morning and I felt I aced my technical interview just now =) Thanks Dave!◦GO now!!! Dave is why I have the best job I have ever had!!!
  •  Daniel I. – Great presentation because you made me realize that I’m not doing enough to better my career! You struck a chord when you said we should keep our resume up-to-date and on-hand at all times. Thanks for helping me realize something I should have been doing a long time ago. Your DVD is very helpful. The fact that you have hiring managers and recruiters giving interviewing tips is great. I’m glad I bought it!
  •  Ken – Thanks for the great presentations – really enjoyed all your presentations at the code camp, learned a lot about interviewing and gained a lot of insight into how recruiting process works.
  •  Stacy P. – An invaluable presentation for less experienced developers and a great review for senior developers that should know better.
  •  Dennis M. – Great presentation, kept me awake and aware, things we often forget and ignore about preparations and you definitely covered that.

Please take the How Do You Find A Job survey before attending this session (you could win a free copy of my Rock Your Technical Interview DVD).

Miss this session or want to see it again? You can by clicking here.

Rock Your .NET Coding Standards

(location TBA)

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about common coding mistakes, code style, application setup, writing better types and much, much more. Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET. This session is based on my book, David McCarter’s .NET Coding Standards. After attending this session, you will be a Code Shark™ just like me! Even though code examples in this session are in .NET, the concepts can be applied to any language. This is part one in my series titled “Improving Code Quality… One Developer At A Time”.

Here’s What Attendees Are Saying About This Session

Joseph D. – I saw this presentation at the SoCal Code Camp, and was a little shell shocked about all the things that the other courses (Pluralsite, MVA, Channel 9) failed to state.

How to become a Better Speaker

(info coming soon)

More Info

Anyone seen with any item from my Code Camp store, will win some cool swag!

Check out my other conferences sessions by going here: http://bit.ly/dotNetDaveOnDemand

dotNetDave Rocks SQL Saturday #611

I hope you will join me for SQL Saturday in Orange County, California on April 1, 2017. I will be doing the session below.

Rock Your Technical Interview

2:45 pm in Humanities 305

Have you ever not gotten a job because you weren’t prepared for the interview? Would you like a big raise? Do you need motivation to rock your career? I’ve interviewed 100’s of software developers and will share my knowledge on how to survive, what we look for and even divulge some of the secrets we use during the process. Whether you are looking for a new position within your company or at a new company you need to attend this session. Included are crazy and strange interview stories from engineers just like you! Learn tips to get you started, working with recruiters, getting prepared, the technical interview and more. You will also learn what is the #1 question you need to ask during an interview… it’s a game changer!

Here’s What Attendees Are Saying About This Session

  • Chris S. – I wanted to thank you for your DVD on Technical Interviews. I attended your presentation at Desert Code Camp and purchased the DVD. Your guidance on how to handle technical and even non-technical questions gave me great support and confidence going into a round of interviews I had. That confidence translated into performance as I was able to receive attractive offers from multiple companies, and I was able to make an important move that has been a life-altering, exciting change for me.
  • Bill W. – Good information! I had forgotten to study the technical questions, did that this morning and I felt I aced my technical interview just now =) Thanks Dave!◦GO now!!! Dave is why I have the best job I have ever had!!!
  • Daniel I. – Great presentation because you made me realize that I’m not doing enough to better my career! You struck a chord when you said we should keep our resume up-to-date and on-hand at all times. Thanks for helping me realize something I should have been doing a long time ago. Your DVD is very helpful. The fact that you have hiring managers and recruiters giving interviewing tips is great. I’m glad I bought it!
  • Ken – Thanks for the great presentations – really enjoyed all your presentations at the code camp, learned a lot about interviewing and gained a lot of insight into how recruiting process works.
  • Stacy P. – An invaluable presentation for less experienced developers and a great review for senior developers that should know better.
  • Dennis M. – Great presentation, kept me awake and aware, things we often forget and ignore about preparations and you definitely covered that.

Watch Session NOW!

Can’t make it to this conference or want to watch this session again? Now you can by clicking here.

Resources

 

 

Rock Your Microsoft .NET Coding Standards (2017)

I’ve released a brand new video of my conference session titled “Rock Your Microsoft .NET Coding Standards” on demand. This video has lots of new tips, tricks and guidance.

To see this session, live and in person click here to check out my conference schedule.

Rock Your Microsoft .NET Coding Standards from David McCarter on Vimeo.

Rock Your Development With A Real World Example

I’ve just released by brand new conference session “Rock Your Development With A Real World Example” on video-on-demand. This video is for you if you want to see how I implemented proper architecture in Microsoft Azure.

To see this session, live and in person click here to check out my conference schedule.

Rock Your Development With A Real World Example from David McCarter on Vimeo.

This session will demonstrate concepts in the first four parts of my series titled “Improving Code Quality… One Developer At A Time” with an real world app that attendees used during this session. This app that runs from the cloud (Azure) will show how I use proper architecture design along with coding standards, defensive programming by properly implementing OOP, logging of events and exceptions, code obfuscation, unit testing, strong naming and much more.  Even though code examples in this session are in .NET, the concepts can be applied to any language. This is part five in my series titled “Improving Code Quality… One Developer At A Time”.

Rock Your Technical Interview (2017)

I’ve just released a brand new version of my Rock Your Technical Interview conference session on video-on-demand. It’s packed full of new tips for 2017!

To see this session, live and in person click here to check out my conference schedule.

Röck Yoür Technical Interview from David McCarter on Vimeo.

Save 50% if you purchase before the end of February.

Getting Unit Tests Created with IntelliTest Working On VSTS

While evaluating Visual Studio Test Services to build, test and deploy our projects for the company I work for, ran into an issue with running unit tests created with IntelliTests. Simply, the test project would not build due to the PEX engine DLL’s not being installed on the images VSTS uses.

I contacted support and they had some ideas, but I had a simpler one… just put the dll’s needed for the build into our source repository. Easy!

This is how I set it up for my open source project. I created a Dependencies folder in the root of my project. Then added these DLL’s:

  • Microsoft.ExtendedReflection.dll
  • Microsoft.ExtendedReflection.Reasoning.dll
  • Microsoft.Pex.Framework.dll
  • Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

Then I went to my test project and removed the reference to the last two DLL’s. Then I added the references back pointing to the Dependencies folder and the build and tests run perfectly!

Unfortunately, IntelliTests do not work in .NET Core. If you love them as much as I do, PLEASE contact Microsoft and tell them you want IntellieTests in Core!

Please comment if you have any other issues and solutions that you have come up with when using VSTS.

 

 

.NET Framework => Core: LINQ AsParallel

In the .NET Framework, if we wanted to process a loop on multiple cores, we simply added AsParallell to the end of the collection as seen below:

var files = new List();
foreach (var directory in directories.AsParallel())
{
  if (directory.Exists)
  {
    var foundFiles = directory.EnumerateFiles(searchPattern, 
                                              searchOption);
    lock (files)
    {
      files.AddRange(foundFiles);
    }
  }
}

In .NET Core, it’s a bit different. For this to work you need to install System.Threading.Tasks.Parallel from NuGet. Then change your foreach to Parallel.ForEach as shown below.

var files = new List();

Parallel.ForEach(directories, (directory) =>
{
  if (directory.Exists)
  {
    var foundFiles = directory.EnumerateFiles(searchPattern, 
                                              searchOption);
    lock (files) files.AddRange(foundFiles);
  }
});

I recommend making this change before porting code to .NET Core. I’m hoping one of the refactoring tools like CodeRush or ReSharper will include a refactoring feature that will make this transition easier.


More code like this can be found in my open-source project on GitHub: http://bit.ly/DNTUtility


 

.NET Framework => Core: Getting The App Data Folder

This is the first in my series of blog posts that will describe major changes to coding if you are trying to convert from the .NET Framework to .NET Core.

First up, getting the folder the app should use to save data. In the .NET Framework it was really easy by doing the following:

public string AppDataFolder()
{
  var path = System.IO.Path.Combine(Environment.GetFolderPath(
    Environment.SpecialFolder.LocalApplicationData), 
    My.Application.Info.CompanyName.Trim);
  return path;
}

Unfortunately, not so easy or “built-in” in .NET Core. Here is the work around:

public static string AppDataFolder()
{
  var userPath = Environment.GetEnvironmentVariable(
    RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? 
    "LOCALAPPDATA" : "Home");

  var assy = System.Reflection.Assembly.GetEntryAssembly();
  var companyName = assy.GetCustomAttributes<AssemblyCompanyAttribute>()
    .FirstOrDefault();
  var path = System.IO.Path.Combine(userPath, companyName.Company);

  return path;
}

Besides a lot more work just to get the data folder, I’d like to point out something new, the RuntimeInformation.IsOSPlatform method. Since Core supports multiple non-Windows OS’s, this is an important method to remember going forward.


More code like this can be found in my open-source project on GitHub: http://bit.ly/DNTUtility