Daniel Hillebrandhttps://danielhillebrand.com
Tech and stuff, mostly .NET and web related.Wed, 03 Oct 2018 15:59:30 +0000en-UShourly1https://wordpress.org/?v=4.9.8132759990Developer and Power User Tools for Windowshttps://danielhillebrand.com/2018/06/developer-and-power-user-tools-for-windows/
Wed, 27 Jun 2018 16:10:47 +0000https://danielhillebrand.com/?p=161Continue reading Developer and Power User Tools for Windows]]>This is a collection of the important tools for development and productivity I currently use (C#, ASP.NET, WPF, JavaScript) . Please let me know in the comments if I miss out a must-have tool.

.NET

LINQPad – Amazing power-tool. Instantly test .NET code snippets, query your database, create and analyse LINQ/Entity framework queries. Most used by me to create, analyse and run LINQ to entities queries. It will show the generated SQL and query you database for you. Great learning utility also. It has a ton of code examples from the book C# 3/4/5/6/7 in a Nutshell.

ReSharper – Helps you writing better code. Tons of hints for improvements. Great test-runner. Stopped using it lately for performance-reasons but will try again after upgrading my machine.

Graphics

Media

ActivePresenter– Records your screen and microphone. Used it for recording tutorials (screencast for YouTube). It also makes a great tool for helping you test your GUI, as you can record what you are doing and what is happening. When something breaks, you can replay and go back in time. Version 7 did not work for me, better try Version 6 of their program while it’s still available.

EyeLeo – Prevents eye strain. Gentle reminders now and then to get your eyes off the screen.

Tomighty Pomodoro timer – Get more done with more breaks. The Pomodoro technique works out great for development. Moving my body every half-hour amps up my creativity and helps me getting unstuck. I prefer to move my body, jog for a couple of minutes. Many times it’s off the screen when the aha-moments hit me.

For a much more extensive list of tools check out the resource from Scott Hanselman. Last time I checked it has been updated in 2014, but still of great value for discovering stuff:

Don’t mix testing frameworks (MsTest, NUnit, xUnit). Live testing will use one or another test adapter, but only one at the same time. Depending on which one is active you will have tests excluded from live-testing.

Update your references. If you cannot debug your unit-tests anymore with Live Unit Testing enabled, have a look at this support case. You might need to delete your existing project reference to “Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll” and install the NuGet packages MSTest.TestAdapter and MSTest.TestFramework instead.

Choose your tests wisely. You might want to exclude your long-running integration tests and other tests from being executed by Live Unit Testing: Right-Click on your test project, go into that “Live Unit Testing” entry and include and exclude what you need to be covered by Live Testing.

Included test files not updated automatically. If you have included test-data files in your project that are copied to your Output Directory by the build process: These are not updated automatically. I had to Stop and Start Live Testing in order to access added or updated files.

Hope you find that helpful.

]]>139Breakpoint in ASP.NET MVC View not hit when using RazorGeneratorhttps://danielhillebrand.com/2017/11/breakpoint-in-asp-net-mvc-view-not-hit-when-using-razorgenerator/
Fri, 10 Nov 2017 09:29:17 +0000https://danielhillebrand.com/?p=127If your breakpoints in an ASP.NET MVC view are not hit: Check if you are using RazorGenerator for this particular view:
RazorGenerator enabled for ASP.NET MVC view

Fix: Temporarily disable Razor Generator removing the “RazorGenerator” text from the Custom Tool property. Make sure to put it back in after your debugging session.

]]>127Change of connection string in deployed WEB.CONFIG overridden by Application settinghttps://danielhillebrand.com/2017/11/change-of-connection-string-in-deployed-web-config-overridden-by-application-setting/
Mon, 06 Nov 2017 11:24:56 +0000https://danielhillebrand.com/?p=125Continue reading Change of connection string in deployed WEB.CONFIG overridden by Application setting]]>I just had an issue with a deployed ASP.NET app on Azure: I changed the connection string in the deployed web.config using the new App Service Editor in the Azure Portal, but the changes had no effect in my application!

This answer from StackOverflow gave me the hint I needed: My connection string was being overridden by an Application Setting in the Azure App Service. I didn’t even know that it was configured.

To see if you have a connection string defined in your Azure App service log into the Azure Portal, open your App Service and go to Settings -> Application Settings -> Connection strings.

Fixes

Delete the connection string in the Azure application settings. Now you can change the connection string in the web.config using the App Service Editor, for example.

Use the Azure application settings to manage your connection strings. The values defined here will always override the connection strings from your web.config.

Unfortunately you won’t get any compiler or intellisense warning to tell you. When trying to run the test in ResSharper unit test runner it will first get a blue question-mark icon and when you run it individually it will get the test result Inconclusive.

Enter the command sqllocaldb infoat the prompt. The result is the name of your SQL Server LocalDB instance.

Enter the command sqllocaldb stop InstanceName. Replace “InstanceName” with the name you got from the previous command.

Enter the command sqllocaldb delete InstanceName. Replace “InstanceName” as in the command before.

Commands to stop and delete the LocalDB database.

Open the folder where the database files (*.mdf) are stored.

Open App-data folder in Windows Explorer

Delete the two *.mdf files in the folder.

Depending on your configuration your database will be re-created automatically when you execute your application or running Update-Databasein the Package Manager Console.

]]>https://danielhillebrand.com/2017/09/how-to-reset-a-sql-server-localdb-instance-in-visual-studio/feed/2112Show PDF in browser instead of downloading (ASP.NET MVC) without JavaScripthttps://danielhillebrand.com/2017/09/show-pdf-in-browser-instead-of-downloading-asp-net-mvc-without-javascript/
Mon, 04 Sep 2017 19:00:42 +0000https://danielhillebrand.com/?p=105Continue reading Show PDF in browser instead of downloading (ASP.NET MVC) without JavaScript]]>If I want to display a PDF file in the browser instead of downloading a copy, I can tell the browser via an additional Content-Disposition response header.

This code example assumes that the file content is available as byte-array, reading the content from a database, for example.

I was forced to wear glasses a few years ago for which I blame my screen-time. Since then I am more conscious about the health of my “biological data interface” (eyes) and just got myself computer glasses with blue filter, although I am not sure if they are necessary. The information available on the web is contradictory, but I have an acquaintance who fixed her problem getting tired with computer-glasses.

What DID convince me though is this free tool for Windows-User: EyeLeo. It will ask me every now and then to exercise my eyes. Together with Tomighty Pomodoro timer I get the frequent breaks I need to finish my work days without my eyes hurting.

]]>103Configure FTP account to download Azure diagnostics logshttps://danielhillebrand.com/2017/08/configure-ftp-account-to-download-azure-diagnostics-logs/
Mon, 21 Aug 2017 15:27:16 +0000https://danielhillebrand.com/?p=93Continue reading Configure FTP account to download Azure diagnostics logs]]>If you just published your web app to Azure with Visual Studio you probably won’t have a FTP account configured in your App Service. I just want to share how to set it up to enable downloading logs via FTP.

If you go to “MONITORING-> Diagnostics logs” in your App Service you should see the text “No FTP/deployment user set” in the field FTP/deployment username:

Diagnostics logs download configuration

Use the page “DEPLOYMENT -> Deployment credentials” to set up a new FTP user:

Deployment credentials configuration

If you go back to “Diagnostics logs” you will see the FTP/deployment username you can use to access the logs with the FTP client of your choice (On Windows I like to use WinSCP):

Diagnostics logs download configuration (updated)

Important: You have to use the full FTP username shown on the “Diagnostics logs” page consisting of the App Service name, a backslash followed by the FTP username:

AppServiceName\FTPUser

Hint: Try to avoid FTP and use FTPS instead to protect your credentials and data.

]]>93Azure App Service: View and Edit the deployed web.config with Kuduhttps://danielhillebrand.com/2017/08/azure-app-service-view-and-edit-the-deployed-web-config-with-kudu/
Mon, 14 Aug 2017 19:13:09 +0000https://danielhillebrand.com/?p=80Continue reading Azure App Service: View and Edit the deployed web.config with Kudu]]>We can use the Azure Portal and Kudu to view and edit the web.config of our deployed app in the App Service: