IronPython-2.0 RC1 in an ASP.NET 3.5 website with C# and VB code-behind raises warnings and errors.
How to reproduce:
- In Visual Studio 2008, create a new ASP.NET Website; choose language as C#.
- Open the website Properties and target .NET Framework 3.5.
- Add a new Web Form with Visual Basic language.
- Build (should be OK).
- Add reference to IronPython.dll (2.0.11020.0), IronPython.Modules.dll (same), Microsoft.Scripting.Core.dll (1.0.11020.0), Microsoft.Scripting.dll (same).
- No errors in build.
- Build errors and warnings:
(0,0): warning CS1685: The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\WINDOWS\assembly\GAC_MSIL\System.Core\126.96.36.199__b77a5c561934e089\System.Core.dll'
InternalXmlHelper.vb(9,0): error BC30560: 'ExtensionAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'.
InternalXmlHelper.vb(24,0): error BC30560: 'ExtensionAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'.
InternalXmlHelper.vb(39,0): error BC30560: 'ExtensionAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'.
- InternalXmlHelper is a class that is embedded in source code form inside vbc.exe in C:\WINDOWS\Microsoft.NET\Framework\v3.5.
- The procedure above would work with IronPython 2.0 Beta 5.
- This situation is similar to what happened with Beta 1. The workaround in that case was putting Microsoft.Scripting.Core.dll in the GAC. Maybe putting Microsoft.Scripting.ExtensionAttribute.dll in the GAC would help now. The problem is that Microsoft.Scripting.ExtensionAttribute.dll
is included in the website's Bin directory even if it is not referenced, and so this assembly is used when the website is compiled.
- I suggest, if possible, that this scenario should be added to your tests, to avoid further regressions.