Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializable attribute exists in both System.Runtime.Serialization.Formatters and nunit.framework #18123

Closed
SerhiiS-in6k opened this issue Aug 16, 2016 · 5 comments
Assignees
Milestone

Comments

@SerhiiS-in6k
Copy link

Hi I have issue with Serializable attribute

The type 'SerializableAttribute' exists in both 'System.Runtime.Serialization.Formatters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'nunit.framework, Version=3.4.1.0.

How can I specify the package to use? My project.json :

{
  "version": "1.0.0-*",
  "testRunner": "nunit",
  "buildOptions": {
    "debugType": "portable",
    "allowUnsafe": true,
    "define": [ "WIN64" ]
  },
  "frameworks": {
    "netcoreapp1.0": {
      "buildOptions": {
        "compile": {
          "exclude": [ "Tests/**/*.cs", "Examples/**/**/AssemblyInfo.cs" ]
        },
        "define": [ "NETSTANDARD1_6" ]
      },
      "dependencies": {
        "NETStandard.Library": "1.6.0",
        "System.Runtime": "4.1.0",
        "System.Runtime.Serialization.Formatters": "4.0.0-rc3-24212-01",
        "System.Dynamic.Runtime": "4.0.11",
        "System.Threading.ThreadPool": "4.0.10",
        "System.Reflection.TypeExtensions": "4.1.0",
        "System.Diagnostics.StackTrace": "4.0.1",
        "System.Diagnostics.Process": "4.1.0",
        "System.Threading.Thread": "4.0.0",
        "dotnet-test-nunit": "3.4.0-beta-1",
        "NUnit": "3.4.1"
      },
      "imports": "dnxcore50"
    },
    "net451": {
      "dependencies": {
        "NUnit": "3.4.1",
        "dotnet-test-nunit": "3.4.0-alpha-2"
      },
      "buildOptions": {
        "compile": {
          "exclude": [ "Tests/**/*.cs", "Tests/service-bus-tests-net4/Properties/AssemblyInfo.cs", "Examples/service-example-csharp-dispatcher/Properties/AssemblyInfo.cs", "Examples/service-example-csharp/Properties/AssemblyInfo.cs" ]
        }
      }
    }
  },
  "runtimes": {
    "ubuntu.14.04-x64": {},
    "win10-x64": {},
    "win7-x64": {}
  }
}

@svick
Copy link
Contributor

svick commented Aug 16, 2016

The same question on dotnet/core: dotnet/core#248.

@shmao
Copy link
Contributor

shmao commented Aug 26, 2016

@SerhiiS-in6k Thanks for opening the issue. Was the error you got a compile time error or a runtime error? I found that NUnit declares an internal type named SerializableAttribute I wondered how that type was conflicting with the one in CoreCLR. Would you mind sharing a simple repro app with us? Thanks.

@svick
Copy link
Contributor

svick commented Aug 26, 2016

@shmao It was changed to internal fairly recently (nunit/nunit#1683). The latest released version of NUnit, 3.4.1, which is used in the project.json above, still has it as public.

@shmao
Copy link
Contributor

shmao commented Aug 27, 2016

Thanks for the pointer, @svick . That fix in NUnit should resolve the issue with NUnit's next release. For 3.4.1, however, I don't see any workaround to reference both packages and use the attribute type.

@shmao
Copy link
Contributor

shmao commented Sep 6, 2016

Closing the issue as NUnit has fixed the issue.

@shmao shmao closed this as completed Sep 6, 2016
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 1.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants