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

Srinivas_Kaira1
Champ on-the-rise
Champ on-the-rise
Hi Alex,

Yes I did add System.Xml.Linq already and added System.Core .Net V4.0 under References section.

Thanks
Srinivas

Alex_French
Elite Collaborator
Elite Collaborator

What specific LINQ (either LINQ-to-XML or LINQ-to-objects) functionality are you using?

I think you may still have a mis-match between the References to actual Assemblies and the "using" statements for namespaces.

If the functionality is LINQ-to-objects, you probably want a reference to System.Core.dll and "using System.Linq".

If the functionality is LINQ-to-XML, you probably want a reference to System.Xml.Linq.dll and "using System.Xml.Linq".

Or you might be using some of both sets of functionality and need all of the above.

UPDATE: I should say that I think the *specific* compile error you're *currently* getting is related to Referenced Assemblies and namespaces.

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

Hi All,

Thanks to every one for all the inputs. Is there a way we could call external assembly containing all Linq - to - XML logic from Unity Script. 

Any references would be helpful.

Thanks 

Srinivas

Hi Srinivas,
That should work. Putting all of your Linq to Xml code in an external assembly would bypass the compiler errors caused by Linq in older versions of OnBase.

Hi Chris,

Is the option to import Importing External Assemblies into Unity Script Configuration present in OB Studio 13.0.2.192?

I am not seeing an option where I can import the external assembly.

Thanks
Srinivas