MEF and seeing what is in the container - mef

When you are dealing with MEF and you have built the MEF Container.
It is possible to find out what is inside your MEF container once it has been built?

There are a few ways you can do this, either:
1 - Debugger... stepping into your code, you'll be able to use debugging features built into Visual Studio to look into your container.
2 - Composition Analysis Tool - (http://msdn.microsoft.com/en-us/library/ff576068.aspx) - which is a command-line tool for analysing assemblies to discover what parts are available.
3 - If you are using ASP.NET with Glimpse, you might want to look at a plugin I started developing that explores your container too: (https://github.com/Antaris/Glimpse.MEF):
4 - Roll your own.

Related

Porting a pywinauto script from Windows to X11/Xlib

In my organization, I have been using pywinauto to automate some UI procedures that could not be done using the sole command line interface.
In an effort to move away from windows, I am evaluating the effort to port the UI automation script to a Linux environment (our tool has a Linux version, including a similar GUI).
I have had a look at the python-xlib project. But I have the feeling that it is more a framework to develop native X11 applications rather than perform tests on an existing application (I could not find anything like find_window etc...).
Do you have any advice for an X11 framework to automate UI procedures?
Based on several inputs, I finally came up with the following suggestions:
use pywinauto which has some beta level of Linux support (this support is based on pyatspi2).
use directly pyatspi2 to interact with the widgets if they are exposed. To browse through the exposed widgets of the application you want to automate, you can use accerciser.
finally, many framework exist to use only click + keys + mouse locations and are based on image comparison. There are many around, I have not yet tested any of them.
Finally, since my script is meant to run in a docker environment in CI, I installed Xvfb to run the automation in headless mode, without graphics HW.

Use NUnit Prefilter by nunit3-console

I'm developing data driven tests using Nunit3 and .Net Core 3.1 and I have many tests with more different data sources, which sometimes have complex logic inside. When I want start only one tests I want to start only one data provider, but I run all. In 3.15.1 ver of NUnit framework was released PreFilter, which solve this problem.
But this feature available only on .runsettings file as I understood docs.
In this question Charlie Poole says that .runsettings is only for VS adapter. But the VS adapter takes a long time to run my tests.
I found info for configuration file but don't undestand what I can configure in this file 0_o
Can I run my tests by NUnit Console Runner 3.12.0-beta1 with PreFilter?
I'm afraid not, no.
There's an open issue to implement it here: https://github.com/nunit/nunit-console/issues/438. You'll see from the VS adapter docs there's several edge-case bugs around this, which will be more visible in the adapter than in the console. At this point in time, nobody has yet taken on that task of implementing this feature in the console.

How to migrate containerized app to Visual Studio?

Is there a way to run and debug a solution with custom pre-existing docker-compose and DOCKERFILEs when migrating to Visual Studio?
I'll try to elaborate as requested:
I'm working on a .Net Core project with multiple services (web APIs), each one with a respective DOCKERFILE. The containers and their dependencies are built and run via a compose file which is used for CD purposes and is optimized for our needs, but I can't use it together with VS2019 because the IDE doesn't recognize these files, and forces the creation of a new docker-compose (in the solutions' root folder) and DOCKERFILE when I attempt to add orchestrator support to any of the projects. These behavior results in the error message "the file ./docker-compose.yml already exists" and the creation of the docker-compose project fails (I'm following the instructions from here: https://learn.microsoft.com/en-us/visualstudio/containers/tutorial-multicontainer?view=vs-2019)
I don't want pollute my repository with the files generated by Visual Studio, but the naming convention used by the IDE makes ignoring them not as simple as it should (IMHO).
So, my question is, is it possible to use a custom docker-compose and DOCKERFILEs when adding container orchestrator support to my projects in Visual Studio?

How do I add Platform Update 1 to my bootstrapper?

I have been playing around with the new StateMachine workflow that has been added to Windows Workflow as part of Platform Update 1 (see also). I now want to look at installing what I've created and therefore need to make sure my bootstrapper is up-to-date. In the future, I will be moving to WIX but right now, for the purposes of prototyping, I'm just using a regular Setup and Deployment project and its bootstrap support.
The list of standard pre-requisites does not include the PU1 as an option. Therefore, how can I add support for it?
Update
I found this answer on StackOverflow regarding custom prerequisites, which led me to this article on MSDN, which led me to creating my own pre-requisite. However, I got a new error about mismatched framework requirements. I suspect I need to pick apart the multi-targeting support and the existing .NET framework prerequisite package to see how to make a new prerequisite that will work correctly.
I've had a stab at creating my own bootstrapper packages for this. The results are here to download. Note that these are entirely untested and provided as-is - use at your own risk. However, feedback is welcome. Hopefully Microsoft will provide an official solution.
See How to detect if the .NET Framework Platform Update 1 is installed
is the Microsoft .NET Framework 4 Platform Update 1 - Runtime Update (KB2478063) what you are looking for? See here for the download.

Is MEF Production ready?

I have to create a pluggable web app at work and I was looking at MEF which is supposed to give all the infrastructure needed for plugin model application, however I see it's still in preview, but I was wondering if anyone has used it on a production application?
MEF V1 shipped.