cancel
Showing results for 
Search instead for 
Did you mean: 

using System.XML.Linq in unity WF Script

Srinivas_Kaira1
Champ on-the-rise
Champ on-the-rise

Hi,

I am running into below issue. I am working on a Unity WF Script and I have added V4.0 System.Core also. I am getting below error.

The type or namespace name 'Linq' does not exist in the namespace 'System.Xml' (are you missing an a
ssembly reference?)

Any idea how can I solve this error?

Thanks for the help.

Regards

Srinivas

1 ACCEPTED ANSWER

Scott_McLean
Elite Collaborator
Elite Collaborator

Hi Srivinas,

This is an issue in versions earlier than 16. Linq includes static references that are incompatible with the Unity script environment.

Options to fix the problem are:

1. Upgrade to v16, where Linq is supported

2. Convert to a loop or other object that doesnot use Linq

Hope that helps,

-Scott

View answer in original post

15 REPLIES 15

Alex_French
Elite Collaborator
Elite Collaborator

Have you added a using statement in addition to the Reference?

You probably just need:


using System.Linq;

Scott_McLean
Elite Collaborator
Elite Collaborator

Hi Srivinas,

This is an issue in versions earlier than 16. Linq includes static references that are incompatible with the Unity script environment.

Options to fix the problem are:

1. Upgrade to v16, where Linq is supported

2. Convert to a loop or other object that doesnot use Linq

Hope that helps,

-Scott

Hi Scott,

Good to hear from you.

We are on V13. Do you know if Unity Script has problems with XML.Linq also?

Thanks
Srinivas

Yeah. You're not going to be able to use Linq in v13. Sadly, this means building longer routines to replace the simplified Linq ones (or of course, upgrading to v16, where this is fixed).