Home » Microsoft » 70-487 v.2 » How should you complete the markup in the Web.config file?
DRAG DROP
You are developing a web application that uses an assembly named MyAssembly.
You need to ensure that when MyAssembly version 1.0.0.0 is requested, version 2.0.0.0 is used.
How should you complete the markup in the Web.config file? To answer, drag the appropriate elements to the correct locations. Each element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:
Correct Answer:
Explanation/Reference:
Explanation:
Box 1: assemblyBinding
Box 2: bindingRedirect
To redirect one assembly version to another, use the <bindingRedirect> element.
Box 3: OldVersion
Box 4: NewVersion
The newVersion attribute should specify a single version. For example, <bindingRedirect oldVersion="1.1.0.0-1.2.0.0" newVersion="2.0.0.0"/> specifies that the runtime should use version 2.0.0.0 instead of the assembly versions between 1.1.0.0 and 1.2.0.0.
Box 5: assemblyBinding
The following code example demonstrates a variety of binding redirect scenarios. The example specifies a redirect for a range of versions for myAssembly, and a single binding redirect for mySecondAssembly.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="mySecondAssembly" publicKeyToken="32ab4ba45e0a69a1" culture="en-us" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
References: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions