[Mono-dev] [Bulk] Re: recharge.sh problems (monocharge-20070111.tar.gz)

Andy Hume andyhume32 at yahoo.co.uk
Sun Jan 14 15:30:33 EST 2007


Yup, I wondered whether there should be a .cmd file for Windows.

But I did actually get the script to run and it worked for the FX1.1
stuff, but failed in the FX2 phase due to the missing gacutil in ./2.0/.
And as I reported, when I changed it to use the gacutil from ./1.0/ it
failed -- very noisily; see the two lines starting ** in section 3 in my
original email (RuntimeCompatibilityAttribute) and verbatim this time; a
dialog box error, followed by the command-line output:
[[
---------------------------
Error
---------------------------

** ERROR **: Can't find custom attr constructor image:
d:\temp\monocharge-20070111\2.0/System.Xml.dll mtoken: 0x0a0002d7
aborting...

---------------------------
OK   
---------------------------
$ env MONO_PATH=./2.0 mono ./1.0/gacutil.exe /i 2.0/System.Xml.dll /f
/package 2.0 /root /temp/Mono-20070111on1.2.2.1/lib

** (./1.0/gacutil.exe:1076): WARNING **: Missing method .ctor in
assembly d:\temp\monocharge-20070111\2.0/System.Xml.dll, type
System.Runtime.CompilerServices.RuntimeCompatibilityAttribute

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
]]


However given your suggestion, I tried the script again with
./1.0/gacutil.exe for the FX2 phase and saw the same behaviour, but then
tried without the "MONO_PATH=./2.0" prefix and it appears to work. :-)  

So is that the solution; just make the latter line
    MONO_PATH=./1.0 mono ./1.0/gacutil.exe /i $i /f /package 2.0 /root
${libdirNative}
(Seems a bit odd that forcing a later version causes problems...)  Why
is the MONO_PATH setting required?  Is it ok to access the FX2 GAC with
FX1_1 tools and libraries? (I presume so).

(Where is the reference to RuntimeCompatibilityAttribute?  The loading
of the target assembly?  Would it not fail if gacutil.exe used
Assembly.ReflectionOnlyLoadFrom rather than Assembly.LoadFrom?  Assuming
that would work...).

Not too many questions I hope... :-'(
Andy


> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com 
> [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Andrus
> Sent: 14 January 2007 16:00
> To: mono-devel-list at lists.ximian.com
> Subject: [Bulk] Re: [Mono-dev] recharge.sh problems 
> (monocharge-20070111.tar.gz)
> 
> Use the following command in windows cmd shell in .bat file
> 
> for %%i in (2.0\*.dll) do mono 1.0\gacutil.exe /i %%i /f /package 2.0
> 
> Some time ago I posted proposal to include native windows 
> script in monocharge but havent got any reply.
> 
> Anrus.
> 
> ----- Original Message -----
> From: "Andy Hume" <andyhume32 at yahoo.co.uk>
> To: <mono-devel-list at lists.ximian.com>
> Sent: Sunday, January 14, 2007 5:24 PM
> Subject: [Mono-dev] recharge.sh problems (monocharge-20070111.tar.gz)
> 
> 
> > Hi
> >
> > I tried to use the recharge.sh script from 
> monolite-20070111.tar.gz to
> > update my install and had some problems.  I'm doing this on 
> Windows so
> > some of the problems I had are cross-platform problems, but 
> some seem
> > general.
> >
> > Do we know if people use the recharge.sh script 
> successfully on a unix
> > platform?  I would expect that at least #3 occurs...
> >
> >
> > 1. gacutil.exe uses native Windows path but is passed UNIX paths.
> >
> > I passed the correct (UNIX-style) path to the Mono 
> installation that was
> > to be updated to the script (env prefix=...), but had 
> various problems
> > with that, and eventually worked out that gacutil.exe needed a
> > Windows-style path...
> >
> > My bash isn't too good but maybe something like the 
> following is required
> > in recharge.sh, along with changing the "... /root 
> ${libdir}" path of the
> > gacutil command line to "... /root ${libdirNative}".  
> (Maybe libdirNative
> > should be called gacRootDir).
> >
> > if [ $OSTYPE = cygwin ]
> > then
> >  # err...?
> >  libdirNative=`cygpath --windows $libdir`
> > else
> >  libdirNative=$libdir
> > fi
> >
> >
> > 2. If gacutil.exe is given the wrong path, it just creates 
> a new GAC.
> >
> > This caused me much confusion, gacutil wasn't reporting any 
> error, but no
> > changes were apparent.  I discovered that actually a whole 
> new GAC had
> > been created in a whole new tree at
> > "/cygdrive/e/temp/Mono-20070111_on_1.2.2.1/lib/mono/gac"!  
> I think that
> > gacutil.exe should fail if told to install to a non-existent GAC; it
> > should't just create a new one.
> >
> >
> > 3. Script runs gacutil.exe from "./2.0/".
> >
> > That file doesn't exist.  That resultant path is
> > ".../monocharge-20070111/2.0/gacutil.exe"  and gacutil only 
> exists in the
> > 1.0 subdirectory (as it does in the installed version).  
> Should there be
> > gacutils.exe in both versions?
> >
> > BTW I tried changing the script's path, to 
> ./1.0/gacutil.exe but that was
> > NOT good... (e.g. (typed by hand): "** ERROR ** Cannot find 
> custom attr
> > constructor image: 
> E:\temp\monocharge-20070111\2.0/System.Xml.dll intoken:
> > 0x0a0002d7"
> > and "** (./1.0/gacutil:4824: WARNING **: Missing method 
> .ctor in assembly
> > E:\temp\monocharge-20070111\2.0/System.Xml.dll, type
> > System.Runtime.CompilerServoices.RuntimeCompatabilityAttribute")
> >
> >
> > 2. Apparently leaves behind .mdb files
> >
> > It appears that the script runs correctly for the 
> everything but the GAC
> > 2.0 update but there are lots of .mdb files left behind 
> from the previous
> > version where the .exe itself _has_ been updated.  For instance
> > "Mono\lib\mono\1.0\al.exe[.mdb]", and also caspol, 
> cert2spc, certmgr etc
> > there too; and "Mono\lib\mono\2.0\gmcs.exe[.mdb]", and also ilasem,
> > mkbundle, etc etc.  The GAC apparently correctly deletes 
> the old .mdb
> > files when updating.
> >
> > Don't what the effect of this is?  Though after some manual 
> hacking I did
> > to get be able to test a fixed bug, I got an error about 
> .mdb and .exe not
> > matching...
> >
> >
> > Andy
> >
> >
> >
> > ___________________________________________________________
> > Copy addresses and emails from any email account to Yahoo! 
> Mail - quick,
> > easy and free. http://uk.docs.yahoo.com/trueswitch2.html
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list


		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com



More information about the Mono-devel-list mailing list