Anyone planning to develop a VSTO Add-In may come to realize that documentation and examples are scarce or nonexistent. Recently I have found myself in this exact predicament as I have been developing a Microsoft Word VSTO Add-In to be used in the legislative drafting process. Throughout development, my team has created a handful of solutions for both simple and complex tasks. Many of these solutions could not be found online, and as a result, required significant research and testing. Here are a few examples that I wish I had when I started to develop a VSTO add-in that will hopefully jump-start your VSTO development.
Overriding Default Save Behavior
One of the core features that was required for our Word Add-In was version control. In order to support this functionality, we would need to override the default behavior of Word’s save functionality….
The genetic algorithm is part of a family of algorithms used for optimization problems first conceived of in the 1950s at the Institute for Advanced Study in Princeton, NJ. The algorithm didn’t gain much commercial use until the late 1980s. In this post, I will briefly discuss genetic algorithm and how it works, going over an example of its implementation. I will also discuss what practical problems genetic algorithm can be used to solve. Lastly, I will provide some links for more reading on the subject should you feel like learning more.
So, the Genetic Algorithm gets its name from the fact that it attempts to simulate biological evolution. If you recall from high school biology, all life is composed of DNA, and that DNA is made up of chromosomes, which are made up of Nucleic Acids. When an organism reproduces,…
The biggest thing we take for granted in the current mobile-dominated web is that everything “just works”, no matter what size or type of device you’re on. But what’s the real impact of that expectation?
For customers, the frustration of needing to switch devices can be more than enough to turn them away from a certain product. For product owners, there’s an expectation that everything needs to be created in parallel to be desktop-friendly, tablet-friendly, mobile-friendly, and to have an equal native mobile app for every platform, which can quickly add up in cost. And for developers, there’s the fact that now you have to actually make all those versions of the same app, across completely different technologies for web and native, and have them work similarly enough to not raise any eyebrows.
But luckily, there’s a new way of doing things,…
The Electronic Data Interchange (EDI) consists of a file in a specific format that represents data exchanged in a transaction from supply chain to healthcare. EDI 835 Claim Payment transaction provides payments information in reference to claims in EDI 837 Healthcare Claim format. The details include transactions such as charges, deductible, copay, payers, payee, etc. The information is stored a hierarchical structure. The standard of EDI format is well defined and the complexity can be very overwhelming. Additionally, we do not want this high degree of detail slowing our processing time.
One of the problems that enterprise systems face with EDI is file size. A single EDI 835 may contain multiple claim records and the quantity of claims in a single file can make it very difficult to process the file. Systems are often bogged down when dealing with a very…
The X12 HIPAA transaction set is used across the healthcare industry to transmit claim, enrollment and payment information. Given the importance and ubiquity of these EDI files, you might assume that translating them from ANSI to a relational database format would be well-supported with a range of options.
In practice, a task as common as parsing a claim or encounter and storing it in a database can quickly escalate into a significant problem.
One solution we’ve seen involves archiving a snapshot of the EDI file using filestream storage. This can satisfy some retention requirements, but provides little in terms of fine-grained tracking or analytic capabilities.
A more complete approach is to parse the X12 file into its discrete elements and store them in a relational database. The ideal solution captures the full extent of the EDI transactions while also applying a reasonable leveling of flattening to keep in the number of table joins under control.
So you’ve set up your new chat bot using the Microsoft Bot Framework, and you need to catch messages before they’re read by your dialogs or FormFlows to apply some global or preemptive logic. Luckily, the Bot Framework team thought ahead and built in a concept for handling message interception, called Scorables.
What Are Scorables?
A Scorable is a class that you can register with Autofac (the dependency injection solution used by Bot Framework), that will silently sit in between your externally-facing code accepting incoming user messages, and your internal dialog code. Each one will get the chance to handle the incoming message, and even compete for priority (which is where the “score” originates).
When To Use Scorables
Since they have full access to Autofac and the dialog stack, they can allow you to do anything from:
applying logic across your entire set of dialogs without duplicating…
When building applications with C# and SQL Server, it is often necessary to define codes in the database that correspond with enums in the application. However, it can be burdensome to maintain the enums manually, as codes are added, modified, and deleted in the database.
In this blog post, I’ll share a T4 template that I wrote which does this automatically. I looked online first, and did find a few different solutions for this, but none that worked for me as-is. So, I built this generic T4 template to do the job, and you can use it too.
Let’s say you’ve got a Color table and ErrorType table in the database, populated as follows:
Now you’d like enums in your C# application that correspond to these rows. The T4 template will generate them as follows:
Before showing the code that generates this, let’s point…
Recently, I was met with some friction by the IT department at a client where, they asserted, that a decision had been made years ago to ban Entity Framework. Like many enterprise environments, this client was understandably concerned with the potential pitfalls of embracing Entity Framework. That meant that my job was to convince them otherwise – not to discount their apprehension, but quite the contrary – to demonstrate how EF can be leveraged for its advantages, and avoided for its shortcomings.
Entity Framework (EF) is a broad framework with many optional parts. There are several aspects of EF that provide great benefit, while others are a source of great consternation – particularly from the perspective of the database purist. As the cliché goes, “with great power comes great responsibility,” and so this blog post explores different aspects of EF, and…
This is the error I received when trying to import a managed solution into an organization where an early version of it already existed.
From the import log :
Plugin Types import: FAILURE. Error: Plugin: [PluginAssemblyName], Version=18.104.22.168, Culture=neutral, PublicKeyToken=c66c1d5121b276ee of PluginTypeName: Microsoft.Crm.Entities.PluginType and PluginTypeNode: System.Xml.XmlElement caused an exception.
This one was new to me and caused me to have to do some digging, first I had to be reminded how to start digging, and the first step should be to enable tracing, which you can find here : https://support.microsoft.com/en-us/help/907490/how-to-enable-tracing-in-microsoft-dynamics-crm. Then after that do your import and go to the TraceDirectory to find the internal exception causing this import exception.
That lead me to this exception from the trace logs :
>Crm Exception: Message: Plugin Types import: FAILURE. Error: Plugin: [PluginAssemblyName], Version=22.214.171.124, Culture=neutral, PublicKeyToken= of PluginTypeName: Microsoft.Crm.Entities.PluginType and PluginTypeNode: System.Xml.XmlElement caused an exception., ErrorCode: -2147188718, InnerException: Microsoft.Crm.CrmException: A managed…
Managing the editable properties of your custom objects in SQL Server Integration Services (SSIS) is a great way to improve their usability, but how can you? By properties, I mean the common fields exposed on the Properties tool window in Visual Studio, any time you’re working with a visual designer, and which you’ve probably used any time you wanted to make a precise change, or a quick change.
In SSIS, you can create your own class to handle all of the following types:
Data Flow / Pipeline Components
Control Flow Tasks
For Each Enumerators (for the for each loop task)
For the most part, these custom classes can be directly modified when editing SSIS packages in Visual Studio, and so anything properties you expose on the class can be edited right from Visual Studio without opening up any new UIs. For simple objects especially, these can…