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

Dynamic keyword requires `System.Runtime.CompilerServices.DynamicAttribute' to be defined #16

Open
AIIX opened this issue Dec 10, 2016 · 12 comments

Comments

@AIIX
Copy link

AIIX commented Dec 10, 2016

Using Unity 5.5.0.b7

Error: Assets/GILES/Code/Classes/Serialization/Converters/pb_ObjectContainerConverter.cs(23,43): error CS1980: Dynamic keyword requires `System.Runtime.CompilerServices.DynamicAttribute' to be defined. Are you missing System.Core.dll assembly reference?

@karl-
Copy link
Contributor

karl- commented Dec 10, 2016

Are you compiling with the complete .NET profile and not subset?

@AIIX
Copy link
Author

AIIX commented Dec 11, 2016

Yes using .Net 2.0 and not the subset. I even reInstalled the final release of Unity 5.5 the error is still the same. Also tried changing the project settings in Visual Studio to .Net 4.0 the error remains.

Additionally I'm using unity3d 64bit on Windows10. Also tried the above in Unity 5.4 beta release on the Linux editor the error is the same.

@tomaszzackiewicz
Copy link

The same problem. I tried to add:
using System.Runtime.CompilerServices.DynamicAttribute;

But I get the error:
Assets/GILES/Code/Classes/Serialization/Converters/pb_ObjectContainerConverter.cs(5,39): error CS0234: The type or namespace name DynamicAttribute' does not exist in the namespace System.Runtime.CompilerServices'. Are you missing an assembly reference?

@karl-
Copy link
Contributor

karl- commented Dec 29, 2016

What platform are you targeting?

@tomaszzackiewicz
Copy link

Now, PC, 64bit on Windows10, but later I would like to use it on mobile too.

@karl-
Copy link
Contributor

karl- commented Dec 29, 2016

Looking at the code again I think you could safely just comment out then entirety of pb_ObjectContainerConverter.

@tomaszzackiewicz
Copy link

I have commented out all the code in the file. No errors and I can run the project, but I'm not sure if it won't prevent me from suing serialisation.

@karl-
Copy link
Contributor

karl- commented Dec 29, 2016

If I recall correctly that path was never actually used - I abandoned it for some reason, or at the least didn't find time to finish it. So you should be able to serialize and deserialize without issue.

@tomaszzackiewicz
Copy link

Ok, thank you.

@SavedByZero
Copy link

SavedByZero commented Apr 26, 2017

I'm confused, what's the exact solution here? I never had an issue using the dynamic keyword with .net 2.0 or .net 2.0 subset until recent 5.X releases, so why is a basic variable type suddenly breaking Unity and looking for a class from 4.6?

@kevinw
Copy link

kevinw commented May 9, 2017

I'm running into this issue as well, with Unity 5.6.0f3, under both .NET 2.0 and .NET 2.0 Subset.

@SavedByZero
Copy link

The only thing that worked for me was replacing dynamic with object, and that's only because I'm a weird case with an xml reader that reads variable types as attributes and puts them into a dictionary. In most cases, I would think dynamic and object are fairly different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants