Skip to main content

Posts

Visual Studio: Edit and Continue issues

Huge thanks to Steve French for this one

Like him, I'd been having issues with "Edit and Continue" not working for ages.  I tried everything and none of the usual advice helped at all.  Finally I came across Steve's post here, and as he suggests, uninstalling Stackify Prefix immediately fixed the problem. Turns out everything was fine to start with, it was just Prefix that was getting in the way (probably due to the way it injects itself into the runtime / server / etc).

For reference other settings I tried included:
Tools -> Options -> Debugging -> Enable Edit and Continue
Project Properties -> Web -> Enable Edit and Continue

It kind of sucks because I really liked Prefix, but it's only useful in specific situations, whereas Edit and Continue is much more useful. I guess I'll have to find another profiler...
Recent posts

Installing SQL Server Express to set up an Azure database locally

Installing SQL Express:Download SQL Express installerSwitch to an account with full local admin permissions (our regular accounts don't have these so I had to use a global admin account instead) and install SQL Express with that accountOnce installation completes, make a note of the connection string you're given on the final page of the installerOpen SSMS and connect to the database - default name is localhost\sqlexpressNavigate to Security -> Logins -> New LoginAdd the regular (non-admin) domain account that you'll be using most of the timeOnce added, open that account under the Logins section and then open the "Server Roles" pageAdd the account to the "sysadmin" role Obtaining the Azure database:Open the database and select the "Export" option at the top of the "Overview" pageChoose a storage account and container to drop the export file in and enter the server admin credsOnce the file has been created, access that storage …

Dynamics CRM Microsoft.IdentityModel exception in Windows 10

When trying to connect to Dynamics CRM services on a Windows 10, machine, you might get this error:

Could not load file or assembly ‘Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies

There are plenty of blog posts around that will all tell you to go and install "Windows Identity Foundation", however this is no longer the case for Windows 10 and the installer for WIF will fail.  This is because it's now a Windows feature - install it via the "Turn Windows features on or off" section in "Programs and Features" as mentioned here.

Salesforce admin gotchas

After coming across some of these for the hundredth time, I've decided to keep a list of bizarre inconsistencies / gotchas in Salesforce.


Editable list views for certain objects don't allow editing of record owner field, even though certain object types (e.g. Cases) have a "Change owner" or "Assign" option right there on the list view which does the same thing, so something exactly like this is obviously already implemented.You can mass transfer ownership of accounts, but not contacts. It's because of this.The force.com cli's export-to-csv functionality (force query --format:csv) creates a file that its own CSV parsing functions consider invalid if you try to re-import it (force bulk update whatevs.csv).Adding a custom field to a standard object does not add it to any report types for that object.  But adding a custom field to a custom object does.Unlike every programming, scripting and query language, SOQL doesn't have a comment character.  Not …

"A section using 'configSource' may contain no other attributes or elements" error after installing Application Insights

After installing the Application Insights nuget package to an Umbraco solution, you'll get this error:

A section using 'configSource' may contain no other attributes or elements

<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
     <log4net configSource="config\log4net.config">
         <root>
             <level value="ALL" />
             <appender-ref ref="aiAppender" />
Source File: \project\web.config

This happens because part of the Application Insights installation process adds a <log4net> section to web.config.  Which would make sense, except Umbraco already has a <log4net> section in /config/log4net.config.  So as you can imagine, the solution is to manually move everything its added into that file. Unfortunately you can't just copy/paste the whole lot, but it's not particularly complicated:


Move <appender-ref ref="aiAppender" /> into the lo…

Using the Force.com CLI and Powershell

Deleting: First, write the list of records to a file (you could just save to a variable but it can come in handy to keep a list of IDs when modifying records)

force query "SELECT Id FROM Object__c WHERE Field__c = 'Whatever'" | Out-File .\ids_to_delete.csv

If it's not a big list, just pipe that back into a CSV object and iterate over it, deleting each one with "force record delete"

Import-Csv .\ids_to_delete.csv | % { force record delete Object__c $_.Id }

It's not very fast, so if there's a lot of them you'll need to use the bulk API.  First remove the quotes from the CSV, no idea why, but "force bulk" hates them for some reason.  Then call it like this:

force bulk delete Object__c .\ids_to_delete.csv

If you just have a medium-sized list of IDs to delete and they're not in a CSV (e.g. copypasta from elsewhere), just paste them right into the command line as one big string and .Split() them, like this:

"axxx000000xxxxxAAA axxx…

IIS HTTP Error 500.19, Error Code 0x8007000d

I probably come across this error at least once per year. Ran into it again today when setting up a website to host locally in IIS, on a computer I don't use much.

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:
Module   IIS Web Core
Notification   Unknown
Handler   Not yet determined
Error Code   0x8007000d

Config Source:
   -1:
    0:


Microsoft's documentation for that error code helpfully points out:

"This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element."

Well that clears it up. Just remove the malformed XML element on line 0...

Except that the site runs just fine on other systems, and even in IIS Express on the same machine that's causing the error, so clearly there's no "malformed XML".  Anyway, it turns out that if your web.config has a section for something li…