[IronPython] defined in multiple assemblies (framework 3.5)

Dino Viehland dinov at microsoft.com
Tue Aug 19 20:14:40 CEST 2008


What if you don't add the assembly in the <assemblies> tag - I don't think that should be necessary because you're adding it via the command line.  And .NET should still be able to find/load it because it's in the GAC.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata
Sent: Tuesday, August 19, 2008 11:09 AM
To: Dino Viehland
Cc: Discussion of IronPython
Subject: Re: [IronPython] defined in multiple assemblies (framework 3.5)

            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0<http://3.5.0.0>, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0<http://3.5.0.0>, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0<http://3.5.0.0>, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0<http://3.5.0.0>, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Entity, Version=3.5.0.0<http://3.5.0.0>, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=1f108baf14f877c2, processorArchitecture=MSIL" />
      </assemblies>

This is how the web.config refers to the assembly in GAC.

and this is the compiler options

compilerOptions="/reference:DLR=c:\Microsoft.Scripting.Core.dll"


and this is the error.

(0,0): error CS1703: An assembly with the same identity 'Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=1f108baf14f877c2' has already been imported. Try removing one of the duplicate references.

On Tue, Aug 19, 2008 at 8:48 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:

But can't you leave the assembly in the GAC and have ASP.NET<http://ASP.NET> pick it up from there?  It should be that it can be referenced for compilation from one spot and loaded from the GAC.



From: users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com> [mailto:users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com>] On Behalf Of Dody Gunawinata
Sent: Tuesday, August 19, 2008 10:46 AM

To: Dino Viehland
Cc: Discussion of IronPython
Subject: Re: [IronPython] defined in multiple assemblies (framework 3.5)



Nope. This compiles well but it won't be available for code behind. ASP.Net can only compiles dll located either on the GAC or under /bin directory.

If I put Microsoft.Scripting.Core under /bin and this option, it will generate error

"Error    10    An assembly with the same identity 'Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=1f108baf14f877c2' has already been imported. Try removing one of the duplicate references.
"



On Tue, Aug 19, 2008 at 8:34 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:

Ahh, apparently csc can't pick up assemblies out of the gac...  :(  But you should be able to copy Microsoft.Scripting.Core.dll anywhere you want and then reference it.  Now that it's in the GAC it should get picked up...  So I believe the final answer should be something like:



/r:DLR="C:\Microsoft.Scripting.Core.dll"



Where C:\ is some directory where you decide to stash the DLL.



From: users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com> [mailto:users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com>] On Behalf Of Dody Gunawinata
Sent: Tuesday, August 19, 2008 10:24 AM

To: Dino Viehland
Cc: Discussion of IronPython
Subject: Re: [IronPython] defined in multiple assemblies (framework 3.5)



I might be doing something wrong, but Microsoft.Scripting.Core.dll is definitely in the GAC.

(No space)
compilerOptions="/reference:DLR=Microsoft.Scripting.Core,Version=1.0.0.4000,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL"
generates

"Error    10    A /reference option that declares an extern alias can only have one filename. To specify multiple aliases or filenames, use multiple /reference options."

(Quotes)
 compilerOptions='/reference:DLR="Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"'

Error    10    Metadata file 'Microsoft.Scripting.Core,Version=1.0.0.4000,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL' could not be found

On Tue, Aug 19, 2008 at 8:13 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:

Have you tried quotes?  It should just be getting passed to the command line so maybe quotes need to be present for the compiler to recognize it correctly - or maybe just removing the spaces will work.



From: Dody Gunawinata [mailto:empirebuilder at gmail.com<mailto:empirebuilder at gmail.com>]
Sent: Tuesday, August 19, 2008 10:13 AM

To: Dino Viehland
Cc: Discussion of IronPython
Subject: Re: [IronPython] defined in multiple assemblies (framework 3.5)



hmm..still not working. ASP.Net reads those four qualifier as four additional assemblies.

Error    10    Source file 'Version=1.0.0.4000,' could not be found
Error    11    Source file 'Culture=neutral,' could not be found
Error    12    Source file 'PublicKeyToken=31bf3856ad364e35,' could not be found
Error    13    Source file 'processorArchitecture=MSIL}' could not be found

On Tue, Aug 19, 2008 at 7:43 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:

Doh!  I forgot you probably need to use the fully qualified assembly name -  /reference:DLR=Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL







From: Dody Gunawinata [mailto:empirebuilder at gmail.com<mailto:empirebuilder at gmail.com>]
Sent: Tuesday, August 19, 2008 9:40 AM
To: Dino Viehland
Cc: Discussion of IronPython

Subject: Re: [IronPython] defined in multiple assemblies (framework 3.5)



Yikes..

"Error    19    Metadata file 'Microsoft.Scripting.Core.dll' could not be found". This is weird.


 <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
                  type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0<http://2.0.0.0>, Culture=neutral, PublicKeyToken=b77a5c561934e089"  compilerOptions="/reference:DLR=Microsoft.Scripting.Core.dll">
          <providerOption name="CompilerVersion" value="v3.5"/>
          <providerOption name="WarnAsError" value="false"/>
        </compiler>

On Tue, Aug 19, 2008 at 7:00 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:

Ok, another thought...  can you GAC the DLR assemblies and then add an updated compilers tag to web.config which includes the alias?  Something like:

<system.codedom>
  <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%ECMA_PUBLICKEY%" warningLevel="1" compilerOptions="/reference:DLR=Microsoft.Scripting.Core.dll"/>
  </compilers>
</system.codedom>



-----Original Message-----
From: users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com> [mailto:users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com>] On Behalf Of Fernando Correia
Sent: Tuesday, August 19, 2008 4:19 AM
To: dody at nomadlife.org<mailto:dody at nomadlife.org>; Discussion of IronPython
Subject: Re: [IronPython] defined in multiple assemblies (framework 3.5)

That's a huge issue for my project. I'm trying to leverage the DLR and
IronPython on a ASP.NET<http://ASP.NET> application that targets 3.5. I hope there is
a work-around.

2008/8/19 Dody Gunawinata <empirebuilder at gmail.com<mailto:empirebuilder at gmail.com>>:
> - This pretty much locks up IronPython 2 from any .Net 3.5 based website.
> The ASP.Net MVC framework is based on .Net 3.5 too and they use a bunch of
> System.Core facilities in their code base. The nicest thing about .Net 3.5
> is to be able to use LINQ on code behind and right now when I compile my
> application, I got a bunch of warnings about duplicated LINQ definition
> methods existing in 2 assemblies. Now I cannot use Action<> or Func<> in
> code behind.
>
> - I think this will prevent the next IP for ASP.Net to be able to use .Net
> 3.5 libraries.

_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
nomadlife.org<http://nomadlife.org>



--
nomadlife.org<http://nomadlife.org>



--
nomadlife.org<http://nomadlife.org>



--
nomadlife.org<http://nomadlife.org>



--
nomadlife.org<http://nomadlife.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080819/08d4eb4b/attachment.html>


More information about the Ironpython-users mailing list