Config Transformations /Multiple Config files for Class Library Project +.NET - app-config

I have a .NET Class library project and I have App.Config file, I would like to have multiple config files using transformation as per env/criteria. How can I achieve that ? As it's being a class library I am unable to do it, I have done that in the past for Console and Web Applications. I am using visual studio 2012 and .NET 4.5

You can use this extension. There is an example to download which should help.

Related

Exception while referencing a .Net standard 2.0 project from WPF application

I am getting the following exception while referencing a .Net standard 2.0 project from WPF application developed using .Net framework 4.6.1 project
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.'
Any suggestions?
As of today (using VisualStudio 2017 15.8.4) this still seems to be a common problem:
Transitive dependencies are not correctly handled with the package management format which uses the packages.config file to reference dependencies.
The problem is that VisualStudio 2017 still uses this old package management format by default when you create a new WPF desktop project.
Solution
The solution is to migrate the project references from packages.config file to the new PackageReference node in the .csproj project file.
VisualStudio can do this migration automatically for you. The migration is documented here:
https://learn.microsoft.com/en-us/nuget/reference/migrate-packages-config-to-package-reference
Please note that there is a known issue:
The Migrate packages.config to PackageReference... option is not available in the right-click context menu until NuGetwas initialized.
Another option if your project does not have any package references at all is to change the setting of RestoreProjectStyle to PackageReference in your .csproj file.
https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#using-packagereference-for-a-project-with-no-packagereferences
I hope this helps.
Add reference to Microsoft.EntityFrameworkCore package in your WPF project.

ReactiveUI + Portable Class Library?

I'm porting a WPF app over to Windows Store app. I have some view models that I would like to put into a Portable Class Library. That code uses reactiveui framework. I created the library and I use nuget package manager to add reactiveui to the project. I get this:
Could not install package 'reactiveui-platforms 5.4.0'. You are trying to install this package into a project that targets 'portable-net45+wp80+win', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Is this really an unsupported configuration or am I doing it wrong?
ReactiveUI-Platforms is specifically only the platform-specific code. You need to just reference ReactiveUI-Core in your PCL and reference ReactiveUI-Platforms in your WPF and Windows Store apps, and everything should work.

Microsoft.EnterpriseManagement.CompositionEngine and Microsoft.EnterpriseManagement.Presentation.Core cannot add to Silverlight Project

I am authoring a management pack with custom views using Silverlight / WPF (shared code) and MP authoring console and MP authoring tool in Visual Studio.
I am following this tutorial on custom views.
Widget for SCOM operation and web console - custom
In Section 4.1: It mentions: Add a reference to Microsoft.EnterpriseManagement.CompositionEngine and Microsoft.EnterpriseManagement.Presentation.Core assemblies. These can typically be found in the Console folder of the Operations Manager installation. Attention: the assemblies from the RTM/CU1 installation will not work! You need to download the sample project files and use the included assemblies.
I cannot add references to the Silverlight project. I get an error message:
Is there any way to get around this?
I understand that the .net runtime is different than that of Silverlight. Yet, this tutorial shows a working example, so it there a missing step or a different binary. What am I missing?
In Section 4.1: It mentions: Add a reference to Microsoft.EnterpriseManagement.CompositionEngine and Microsoft.EnterpriseManagement.Presentation.Core assemblies. These can typically be found in the Console folder of the Operations Manager installation. Attention: the assemblies from the RTM/CU1 installation will not work! You need to download the sample project files and use the included assemblies.
The important bit is the bit in bold, you need to download the sample project and copy the references from there. Were you doing this?
http://gallery.technet.microsoft.com/Creating-a-Widget-for-104711ac
If you download this zip and go to the following sub directory
\Creating a Widget for Operations Manager Dashboard - Walkthrough %231.zip\Creating a Widget for Operations Manager Dashboard - Walkthrough #1\Section_4\AlertSummarySilverlight\Bin\Debug
You'll see the two assemblies in this folder. Copying them out of the zip into another folder and add a reference to them. This works for me in Silverlight 5.

.NET Reactor and InnoSetup

I have a VS 2010 C# "solution"; It creates an .exe file, and a .pdb file when doing a build in Release mode which I use in the InnoSetup build of the installer.
My app uses several .dll's from other vendors (i.e. WinSCP). My question is: do still build the installer using InnoSetup, substituting the new .exe from .NET Reactor for the one created by Visual Studio? The only thing I want to obfuscate using .NET Reactor is my app, not the other vendors.
(I have looked in Google and SO, and did not find an answer.)
You could directly substitute the exe/dll before you build the installer.
In case you want to automatically protect a VS project file output (exe/dll) before it is packaged into your into you setup you could use the .NET Reactor Visual Studio Add-in.
Install dotFuscator then you will be able to add its project type in source code as new project. There you can set output files to obfuscate.

Where are the dlls -WebDriver.Common and WebDriver.Firefox in Selenium Web Driver?

I am running some tests on Selenium Web Driver. But looks like that I need some dlls like WebDriver.Common.dll, WebDriver.Firefox.dll.
I had downloaded the web driver api from this link
http://code.google.com/p/selenium/downloads/detail?name=selenium-dotnet-2.1.0.zip&can=2&q=
And when I unzip, could not find the dll that I mentioned in the subject.
I am using Visual Studio 2010 & creating a class library.
Please let me know if there is another link to download the mentioned dll or another way to get this working.
WebDriver.Common.dll, WebDriver.Firefox.dll, and all of the other browser-specific assemblies were combined into a single WebDriver.dll assembly for the final 2.0.0 (and later) releases. You should only have to create a reference to WebDriver.dll to be able to use all of the functionality of the Selenium WebDriver API.
Another helpful step to point out is adding the proper using statements for each driver type.
For Example:
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Chrome;

Resources