Skip to content

Conversation

@jonpryor
Copy link
Contributor

@jonpryor jonpryor commented Sep 2, 2016

After upgrading to Mono 4.6, the generator-Tests.dll unit tests are
failing:

18) Test Failure : generatortests.Streams.GeneratedOK
     /Library/Frameworks/Mono.framework/Versions/4.6.0/bin/mcs /target:library /debug+ /optimize- /out:"Mono.Andoroid"
     /r:"/Users/jon/Dropbox/Developer/Java.Interop/bin/TestDebug/nunit.framework.dll"
     /r:"/Users/jon/Dropbox/Developer/Java.Interop/bin/TestDebug/Java.Interop.dll"
     /r:"/Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5/Facades/System.Runtime.dll"
     /unsafe /noconfig  --
     ...
.../Java.Interop/bin/TestDebug/SupportFiles/JNIEnv.cs(6,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
.../Java.Interop/bin/TestDebug/SupportFiles/JNIEnv.cs(7,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
.../Java.Interop/bin/TestDebug/SupportFiles/JavaArray.cs(4,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
.../Java.Interop/bin/TestDebug/SupportFiles/JavaCollection.cs(4,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
.../Java.Interop/bin/TestDebug/SupportFiles/TypeManager.cs(5,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
  Expected: False
  But was:  True

I don't know why, but Mono 4.6's CSharpCodeProvider is providing
/noconfig, which prevents the default assemblies from being
referenced, including System.Core.dll. This in turn is responsible
for the CS0234 errors when trying to compile the support files.

Fix the CS0234 errors by explicitly referencing System.Core.dll.

After upgrading to Mono 4.6, the `generator-Tests.dll` unit tests are
failing:

	18) Test Failure : generatortests.Streams.GeneratedOK
	     /Library/Frameworks/Mono.framework/Versions/4.6.0/bin/mcs /target:library /debug+ /optimize- /out:"Mono.Andoroid"
	     /r:"/Users/jon/Dropbox/Developer/Java.Interop/bin/TestDebug/nunit.framework.dll"
	     /r:"/Users/jon/Dropbox/Developer/Java.Interop/bin/TestDebug/Java.Interop.dll"
	     /r:"/Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5/Facades/System.Runtime.dll"
	     /unsafe /noconfig  --
	     ...
	.../Java.Interop/bin/TestDebug/SupportFiles/JNIEnv.cs(6,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
	.../Java.Interop/bin/TestDebug/SupportFiles/JNIEnv.cs(7,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
	.../Java.Interop/bin/TestDebug/SupportFiles/JavaArray.cs(4,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
	.../Java.Interop/bin/TestDebug/SupportFiles/JavaCollection.cs(4,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
	.../Java.Interop/bin/TestDebug/SupportFiles/TypeManager.cs(5,14): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core' assembly reference?
	  Expected: False
	  But was:  True

I don't know *why*, but Mono 4.6's `CSharpCodeProvider` is providing
`/noconfig`, which prevents the default assemblies from being
referenced, including `System.Core.dll`. This in turn is responsible
for the CS0234 errors when trying to compile the support files.

Fix the CS0234 errors by explicitly referencing `System.Core.dll`.
@atsushieno atsushieno merged commit 235ff6a into dotnet:master Sep 3, 2016
jonpryor pushed a commit that referenced this pull request Jan 31, 2020
Changes: dotnet/android-tools@66d445c...bfb66f3

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/826178
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/938504
Context: http://feedback.devdiv.io/606218

  * dotnet/android-tools@bfb66f3: Update to sdk-style csproj and netstandard2.0. (#78)
  * dotnet/android-tools@9f4ed4b: Use %ProgramW6432% path for 32-bit apps (#75)
  * dotnet/android-tools@294f447: Merge pull request #77 from xamarin/dev/soch/fix_certs
  * dotnet/android-tools@131bb29: Fix authenticode certs
  * dotnet/android-tools@962c486: Prevent NRE when Android SDK is not found (#73)
  * dotnet/android-tools@9b03310: [Windows] check %JAVA_HOME% for locating Jdk (#74)
  * dotnet/android-tools@cb41333: Get OpenJDK from well-known paths, not just registry (#72)
  * dotnet/android-tools@53ffdae: Downgrade to net46 for compatibility with VS2017+(#69)
  * dotnet/android-tools@4264703: Add AlternateIds for 9.0
  * dotnet/android-tools@90a6e06: [Xamarin.Android.Tools.AndroidSdk] Add 9.0 to KnownVersions.
  * dotnet/android-tools@4f717b6: Check if the path exists before trying to enumerate it. (#67)

Had to add an explicit NuGet restore to build it on Windows because 🤷‍♂.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants