Web.Config Transformation XPath - web-config

I've done the usual checks for similar posts on here and Google (etc) but to no avail.
Basically I have a Visual Studio 2010 MVC3 solution that is using Web.Config transformations and for the most part they're working great. However, I have some unit testing bindings that I want removed and they're a little tricky because of their XML location.
Here is the cut down version:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/Program%20Files/Microsoft%20Visual%20Studio%2010.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter.DLL" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.QualityTools.Common/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.QualityTools.Common.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.ExecutionCommon" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.QualityTools.ExecutionCommon/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Resource" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.QualityTools.Resource/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.QualityTools.Resource.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="AjaxMin" publicKeyToken="21ef50ce11b5d80f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.46.4422.26284" newVersion="4.46.4422.26284" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Esentially I want to remove the nodes that contain a child node with a name containing "Microsoft.VisualStudio".
So far I can get the nodes to empty using some verbose syntax in my transformation Web.Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter" xdt:Transform="Remove" xdt:Locator="Match(name)" />
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Common" xdt:Transform="Remove" xdt:Locator="Match(name)" />
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.ExecutionCommon" xdt:Transform="Remove" xdt:Locator="Match(name)" />
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Resource" xdt:Transform="Remove" xdt:Locator="Match(name)" />
<codeBase version="10.0.0.0" xdt:Transform="RemoveAll" xdt:Locator="Match(version)" />
</dependentAssembly>
<dependentAssembly xdt:Locator="XPath(//runtime/*/*[not(node())])" xdt:Transform="RemoveAll" />
</assemblyBinding>
</runtime>
</configuration>
This sort of works but gives me empty nodes which I don't want.
Any ideas?
Cheers!

This is how I have removed the unneeded dependentAssembly references, not sure if it is the best way, but it works for me:
in Web.config, add a name to all the dependentAssembly entries that are not required for production, I chose to use "QualityTools".
<dependentAssembly name="QualityTools">
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/Program%20Files/Microsoft%20Visual%20Studio%2010.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter.DLL" />
</dependentAssembly>
<dependentAssembly name="QualityTools">
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.QualityTools.Common/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.QualityTools.Common.dll" />
</dependentAssembly>
<dependentAssembly name="QualityTools">
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.ExecutionCommon" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.QualityTools.ExecutionCommon/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll" />
</dependentAssembly>
<dependentAssembly name="QualityTools">
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Resource" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.QualityTools.Resource/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.QualityTools.Resource.dll" />
</dependentAssembly>
In your transform file, add a transform to remove all entries with the name "QualityTools"
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly name="QualityTools" xdt:Locator="Match(name)" xdt:Transform="RemoveAll" />
</assemblyBinding>
Note the Transform is RemoveAll, to remove all entries with that name.

Related

Ignoring Tabs and white spaces in VS Code Search

My solution has many projects, I want to check all of the *.config projects, to be sure if Microsoft.Extensions.DependencyInjection packages are in the version of 6.0.0.0 in all projects.
* But not from NuGet PackageManager Solution
I want to search for
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
As we can see, there are some white spaces or Tabs before <assemblyIdentity> and <bindingRedirect>.
How can I search all these 3 lines in the whole solution no matter of tabs or whitespaces before and after them in VS Code ?
ForExample if I search for
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
then the result could also be:
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>

How can I solve 'MathWorks.MATLAB.NET.Arrays.MWArray' threw an exception?

I got the following error with matlab in asp.net.
I installed "MATLAB Runtime" and followed the instruction by "Build a .NET Application" via
https://ww2.mathworks.cn/help/compiler_sdk/gs/create-a-dotnet-application-with-matlab-code.html
And when I run via "IIS Express(Chrome)" in VS2019, I got the following error.
and in Output display.
Exception thrown: 'System.TypeInitializationException' in MWArray.dll
An exception of type 'System.TypeInitializationException' occurred in MWArray.dll but was not handled in user code
The type initializer for 'MathWorks.MATLAB.NET.Arrays.MWArray' threw an exception.
When I check the "Environment variable"
and when I check the path, I found "mclmcrrt9_6.dll"
sys info.
VS2019
debug platform : x64
framework : 4.5.2
runtime of Web.config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MWArray" publicKeyToken="E1D84A0DA19DB86F" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.19.0.0" newVersion="2.19.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
How can I solve this? Thanks in advance.

Crystal Reports newer runtime broke old applications

I'm working on upgrading a legacy application for my company and for the sake of saving time, I opted to re-use the 20+ reports already done in some older Crystal Reports while using the latest Crystal Reports that support and integrates with Visual Studio 2015.
The new reports in the new system are working but once I deployed to the test server, all older application failed to report once CR runtime was upgraded.
Is this a known behaviour? I don't have sources/permission(s) to modify the CR references. With GAC, this was not supposed to be an issue anymore.
Does anyone have experience with having multiple versions of Crystal Reports running side-by-side?
I had to change reporting to SQL Server Reporting Services to overcome this issue and now, after the project delayed by 1.5 months, I'm very glad I did. We have completely stopped using Crystal Reports in future development and existing legacy applications are bound to old web servers with ancient CR runtimes.
You can build your new applications using a later build of Crystal Reports for VS and install the later version of run time on your computers, but the older applications that use a previous runtime need a .config file to make them work.
In the example below, you could have an application that uses 13.0.2000.0 but has run time 13.0.3500.0 installed on pc (that would be 13 service pack 25) and then make the file names the same as your application and put .config after the name.
For example, an application with executable CutomApplication.exe
CutomApplication.exe.Config (containing the text below)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Web" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ClientDoc" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonControls" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonObjectModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Controllers" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CubeDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataSetConversion" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ObjectFactory" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Prompting" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ReportDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.XmlSerialize" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Can't generate database from .edmx (Npgsql 2.2.5/EF6)

I can connect to my Postgresql database just fine (I generated the .edmx this way in the first place), but I can't generate a database from the .edmx.
The error indicates that no provider with the invariant name 'Npgsql' has been found, and that the entityFramework section of Web.config should be checked for it, but as far as I can tell it's here.
This is an ASP MVC5 application, here's the Web.config:
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="pgArcher" connectionString="Host=localhost;Database=Archerie;user=postgres;password=***" providerName="Npgsql" />
<add name="ArcherieEntities" connectionString="metadata=res://*/ArcherieEDM.csdl|res://*/ArcherieEDM.ssdl|res://*/ArcherieEDM.msl;provider=Npgsql;provider connection string="PORT=5432;TIMEOUT=15;POOLING=True;MINPOOLSIZE=1;MAXPOOLSIZE=20;COMMANDTIMEOUT=20;COMPATIBLE=2.2.5.0;HOST=localhost;DATABASE=Archerie;USER ID=postgres;PASSWORD=***"" providerName="System.Data.EntityClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<add name="Npgsql - .Net Data Provider for PostgreSQL" invariant="Npgsql" description=".Net Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
<add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version= 7.3.422.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>
<entityFramework>
<providers>
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework, Version=2.2.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
</providers>
</entityFramework>
</configuration>
Make sure you installed Npgsql and Npgsql.EntityFramework in the
project (seems to be obvious, but I've seen some cases when people
report errors like yours and just installed these packages in the
"Repository" project).
Npgsql and Mono.Security must be registered in GAC (check the version
you are using).
And at least, add the assembly binding for Npgsql as well:
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.5.0" newVersion="2.2.5.0" />
</dependentAssembly>

Transforming Web Config for release

I have the following XML in my web config and in release mode I need to remove dependentAssembly section depending on the name attribute of its child : assemblyIdentity. I tried the answer here:xdt transform locator that matches subnode content but no luck.
My web.config is something like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Resource" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///c:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2010.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter.DLL" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I have tried the following in my web.release.config to select the second dependentAssembly element for deletion based on the child element but no success.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<!-- Attempt 1 -->
<assemblyIdentity xdt:Transform="RemoveAll"
xdt:Locator="Condition(#name='Microsoft.VisualStudio.QualityTools.Resource')"/>
</dependentAssembly>
</assemblyBinding>
<!-- Attempt 2 -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Remove"
xdt:Locator="Condition(assemblyIdentity/#name='Microsoft.VisualStudio.QualityTools.Resource')">
</dependentAssembly>
</assemblyBinding>
</runtime>
This code works for me.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Replace" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/#name='System.Web.Mvc')">
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
All credit to #Thommy's stackoverflow answer to this post.