MudassarRasool / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Gallio 3.2.1 x86: warning CS1685 #784

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install the release "Gallio 3.2.1 x86" with the msi installer
2. Create a test project in VS2010 (also without any test fixture)
3. Build

What is the expected output? What do you see instead?
Building the test project should get no warning; instead there is the following:
warning CS1685: The predefined type 
'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple 
assemblies in the global alias; using definition from 'c:\Program 
Files\Gallio\bin\Gallio.dll'

What version of the product are you using? On what operating system?
Gallio 3.2.1 x86 on Windows XP SP3 32bit, Visual Studio 2010

Original issue reported on code.google.com by ivan.muz...@gmail.com on 3 Dec 2010 at 11:35

GoogleCodeExporter commented 8 years ago
I'm seeing the same issue, but also seeing a CS0656 error too.

warning CS1685: The predefined type 
'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple 
assemblies in the global alias; using definition from 'c:\...\Gallio\Gallio.dll'

error CS0656: Missing compiler required member 
'System.Runtime.CompilerServices.ExtensionAttribute..ctor'

Original comment by JasonLaFlair on 3 Dec 2010 at 4:56

GoogleCodeExporter commented 8 years ago
We shouldn't be defining ExtensionAttribute anywhere in Gallio.

Original comment by jeff.br...@gmail.com on 4 Dec 2010 at 1:35

GoogleCodeExporter commented 8 years ago
I confirm the issue. I've seen the same warning a few days ago while using a 
v3.3 build just before the release of v3.2.1. I'd presumed it was due to an 
incorrect reference somewhere in a project of mine. Now I suspect it might be 
in relation with the Mono.Cecil 0.6 to 0.9 upgrade (?)

Original comment by Yann.Tre...@gmail.com on 4 Dec 2010 at 8:59

GoogleCodeExporter commented 8 years ago
I was thinking it might be something along the lines of the Mono.Cecil upgrade. 
 However that assembly is supposed to be completely internalized.

Original comment by jeff.br...@gmail.com on 4 Dec 2010 at 9:23

GoogleCodeExporter commented 8 years ago
Yeah, Jb has defined his own copy of ExtensionAttribute so he can trick the 
compiler into letting him use extension methods. I'm not sure what we can do 
about this. We could fork Cecil and reference System.Core, but not if we're 
targeting 2.0. There's no warning if your project doesn't reference System.Core.

Original comment by grahamr...@gmail.com on 4 Dec 2010 at 12:59

GoogleCodeExporter commented 8 years ago
Oh that's REALLY interesting.  Mono.Cecil is properly internalized into 
Gallio.dll.  Clients that link to Gallio.dll can't actually access the embedded 
copy of System.Runtime.CompilerServices.ExtensionAttribute.

So why are users getting compiler errors now and not before?

Anyways, probably the easiest workaround is to write a tiny little command-line 
program that loads the merged Gallio.dll using Mono.Cecil, renames 
ExtensionAttribute to something else, then writes it back out again using 
Mono.Cecil and signs it with the Gallio key.

Original comment by jeff.br...@gmail.com on 4 Dec 2010 at 8:02

GoogleCodeExporter commented 8 years ago
It wasn't in 0.6. Yeah, sounds like a plan.

Original comment by grahamr...@gmail.com on 6 Dec 2010 at 10:25

GoogleCodeExporter commented 8 years ago
I am seeing the same issue: warning CS1685: The predefined type 
'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple 
assemblies in the global alias; using definition from 'c:\Program Files 
(x86)\Reference 
Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll'

Steps to reproduce:
1) Create a new Class Library project in MS Visual C# 2010 Express
2) Open the project properties and make sure the Target Framework is set to 
".NET Framework 4" 
3) Reference Gallio.dll (I do not have it installed, but just unzipped)

Environment:
- Gallio 3.2.767.0
- Windows 7 x64
- .NET Frameworks available: v2.0.50727, v3.0, v3.5, v4.0.30319

Regards,
Yauhen.

Original comment by yauhen.safrankou on 6 Dec 2010 at 11:46

GoogleCodeExporter commented 8 years ago
Issue 787 has been merged into this issue.

Original comment by Yann.Tre...@gmail.com on 11 Dec 2010 at 7:42

GoogleCodeExporter commented 8 years ago
Same problem here, I'm using Gallio 3.3.153.0. And I don't have any projects 
targeting .NET 4.0, just 3.5

Original comment by igor.br...@gmail.com on 16 Dec 2010 at 9:47

GoogleCodeExporter commented 8 years ago
This is fixed in the trunk, will be in the next 3.2 release.

Original comment by grahamr...@gmail.com on 19 Dec 2010 at 6:41

GoogleCodeExporter commented 8 years ago

Original comment by Yann.Tre...@gmail.com on 24 Dec 2010 at 3:55

GoogleCodeExporter commented 8 years ago
Issue 796 has been merged into this issue.

Original comment by Yann.Tre...@gmail.com on 11 Jan 2011 at 6:32

GoogleCodeExporter commented 8 years ago
Thanks for the fix. I tested it on the version 3.2.708.0

Original comment by yauhen.safrankou on 18 Jan 2011 at 9:43