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

I cannot seem to get a project to reference System.Xml.XDocument #552

Closed
ahall-medullan opened this issue May 4, 2015 · 11 comments
Closed

Comments

@ahall-medullan
Copy link

On Mac OSX

When I try to compile source code with System.Xml.XDocument then the compiler gives this output

Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException: /Users/medullanuser/Documents/personal/dnx/main.cs(7,28): error CS0234: The type or namespace name 'Xml' does not exist in the namespace 'System' (are you missing an assembly reference?)
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args) [0x00000] in <filename unknown>:0
@Eilon
Copy link
Member

Eilon commented May 4, 2015

Can you share your project.json file?

@ahall-medullan
Copy link
Author

[image: Inline image 1] http://www.medullan.com Andrew Hall
Medullan Inc. | medullan.com http://www.medullan.com
t: +1 876 374 8032
e: ahall@medullan.com

On Mon, May 4, 2015 at 11:08 AM, Eilon Lipton notifications@github.com
wrote:

Can you share your project.json file?


Reply to this email directly or view it on GitHub
#552 (comment).

@muratg
Copy link
Contributor

muratg commented May 4, 2015

@ahall-medullan I can't see the image you seem to have pasted. Could you paste the json as text?

@ahall-medullan
Copy link
Author

{
"version": "1.0.0-",
"dependencies": {
},
"frameworks" : {
"dnx451" : { },
"dnxcore50" : {
"dependencies": {
"System.Console": "4.0.0-beta-
"
}
}
}
}

[image: Inline image 1] http://www.medullan.com Andrew Hall
Medullan Inc. | medullan.com http://www.medullan.com
t: +1 876 374 8032
e: ahall@medullan.com

On Mon, May 4, 2015 at 12:49 PM, Murat Girgin notifications@github.com
wrote:

@ahall-medullan https://github.com/ahall-medullan I can't see the image
you seem to have pasted. Could you paste the json as text?


Reply to this email directly or view it on GitHub
#552 (comment).

@davidfowl
Copy link
Member

That's because you need to add a reference to it:

{
    "dependencies": {
        "System.Xml.XDocument": "4.0.10-beta-22816"
    },
    "commands": {
        "ConsoleApp": "ConsoleApp"
    },
    "frameworks": {
        "dnx451": { },
        "dnxcore50": {
            "dependencies": {
                "System.Console": "4.0.0-beta-22816"
            }
        }
    }
}

As an example.

@ahall-medullan
Copy link
Author

Thanks for the assistance so far; using the project.json you suggested
gives me this error after doing "dnu restore" then "dnx . run" :

Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException:
/Users/________user/Documents/personal/dnx/main.cs(7,32): error CS0234: The
type or namespace name 'XDocument' does not exist in the namespace
'System.Xml' (are you missing an assembly reference?)
at Microsoft.Framework.ApplicationHost.Program.Main (System.String[]
args) [0x00000] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
[0x00000] in :0
at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute
(System.Reflection.Assembly assembly, System.String[] args,
IServiceProvider serviceProvider) [0x00000] in :0
at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1
args) [0x00000] in :0

[image: Inline image 1] http://www.medullan.com Andrew Hall
Medullan Inc. | medullan.com http://www.medullan.com
t: +1 876 374 8032
e: ahall@medullan.com

On Mon, May 4, 2015 at 1:00 PM, David Fowler notifications@github.com
wrote:

That's because you need to add a reference to it:

{
"dependencies": {
"System.Xml.XDocument": "4.0.10-beta-22816"
},
"commands": {
"ConsoleApp": "ConsoleApp"
},
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"System.Console": "4.0.0-beta-22816"
}
}
}
}

As an example.


Reply to this email directly or view it on GitHub
#552 (comment).

@davidfowl
Copy link
Member

Whats in your project.lock.json file

@ahall-medullan
Copy link
Author

{
"locked": false,
"version": -9997,
"targets": {
"DNX,Version=v4.5.1": {
"System.IO/4.0.10-beta-22816": {
"dependencies": {
"System.Runtime": "4.0.20-beta-22816",
"System.Text.Encoding": "4.0.10-beta-22816",
"System.Threading.Tasks": "4.0.10-beta-22816"
},
"frameworkAssemblies": [
"mscorlib",
"System"
],
"compile": [
"lib/net45/System.IO.dll"
],
"runtime": [
"lib/net45/System.IO.dll"
]
},
"System.Runtime/4.0.20-beta-22816": {
"frameworkAssemblies": [
"mscorlib",
"System",
"System.ComponentModel.Composition",
"System.Core"
],
"compile": [
"lib/net45/System.Runtime.dll"
],
"runtime": [
"lib/net45/System.Runtime.dll"
]
},
"System.Text.Encoding/4.0.10-beta-22816": {
"dependencies": {
"System.Runtime": "4.0.20-beta-22816"
},
"frameworkAssemblies": [
"mscorlib"
],
"compile": [
"lib/net45/System.Text.Encoding.dll"
],
"runtime": [
"lib/net45/System.Text.Encoding.dll"
]
},
"System.Threading.Tasks/4.0.10-beta-22816": {
"dependencies": {
"System.Runtime": "4.0.20-beta-22816"
},
"frameworkAssemblies": [
"mscorlib",
"System.Core"
],
"compile": [
"lib/net45/System.Threading.Tasks.dll"
],
"runtime": [
"lib/net45/System.Threading.Tasks.dll"
]
},
"System.Xml.ReaderWriter/4.0.10-beta-22816": {
"dependencies": {
"System.IO": "4.0.10-beta-22816",
"System.Runtime": "4.0.20-beta-22816",
"System.Text.Encoding": "4.0.10-beta-22816",
"System.Threading.Tasks": "4.0.10-beta-22816"
},
"frameworkAssemblies": [
"mscorlib",
"System.Xml"
],
"compile": [
"lib/net45/System.Xml.ReaderWriter.dll"
],
"runtime": [
"lib/net45/System.Xml.ReaderWriter.dll"
]
},
"System.Xml.XDocument/4.0.10-beta-22816": {
"dependencies": {
"System.IO": "4.0.10-beta-22816",
"System.Runtime": "4.0.20-beta-22816",
"System.Xml.ReaderWriter": "4.0.10-beta-22816"
},
"frameworkAssemblies": [
"mscorlib",
"System.Xml.Linq"
],
"compile": [
"lib/net45/System.Xml.XDocument.dll"
],
"runtime": [
"lib/net45/System.Xml.XDocument.dll"
]
}
},
"DNXCore,Version=v5.0": {
"System.Console/4.0.0-beta-22816": {
"dependencies": {
"System.IO": "4.0.10-beta-22816",
"System.Runtime": "4.0.20-beta-22816"
},
"compile": [
"lib/contract/System.Console.dll"
],
"runtime": [
"lib/aspnetcore50/System.Console.dll"
]
},
"System.IO/4.0.10-beta-22816": {
"dependencies": {
"System.Runtime": "4.0.20-beta-22816",
"System.Text.Encoding": "4.0.10-beta-22816",
"System.Threading.Tasks": "4.0.10-beta-22816"
},
"compile": [
"lib/contract/System.IO.dll"
],
"runtime": [
"lib/aspnetcore50/System.IO.dll"
]
},
"System.Runtime/4.0.20-beta-22816": {
"compile": [
"lib/contract/System.Runtime.dll"
],
"runtime": [
"lib/aspnetcore50/System.Runtime.dll"
]
},
"System.Text.Encoding/4.0.10-beta-22816": {
"dependencies": {
"System.Runtime": "4.0.20-beta-22816"
},
"compile": [
"lib/contract/System.Text.Encoding.dll"
],
"runtime": [
"lib/aspnetcore50/System.Text.Encoding.dll"
]
},
"System.Threading.Tasks/4.0.10-beta-22816": {
"dependencies": {
"System.Runtime": "4.0.20-beta-22816"
},
"compile": [
"lib/contract/System.Threading.Tasks.dll"
],
"runtime": [
"lib/aspnetcore50/System.Threading.Tasks.dll"
]
},
"System.Xml.ReaderWriter/4.0.10-beta-22816": {
"dependencies": {
"System.IO": "4.0.10-beta-22816",
"System.Runtime": "4.0.20-beta-22816",
"System.Text.Encoding": "4.0.10-beta-22816",
"System.Threading.Tasks": "4.0.10-beta-22816"
},
"compile": [
"lib/contract/System.Xml.ReaderWriter.dll"
],
"runtime": [
"lib/aspnetcore50/System.Xml.ReaderWriter.dll"
]
},
"System.Xml.XDocument/4.0.10-beta-22816": {
"dependencies": {
"System.IO": "4.0.10-beta-22816",
"System.Runtime": "4.0.20-beta-22816",
"System.Xml.ReaderWriter": "4.0.10-beta-22816"
},
"compile": [
"lib/contract/System.Xml.XDocument.dll"
],
"runtime": [
"lib/aspnetcore50/System.Xml.XDocument.dll"
]
}
}
},
"libraries": {
"System.Console/4.0.0-beta-22816": {
"sha512":
"Uq1C1DP7MYuE0qqIaI15k/k3r2IKX6A/suIboAkOCLYoiG4jhFfc0ECJVsiXWJEWf7o5xRA0cz+hi+awB5HugA==",
"files": [
"License.rtf",
"System.Console.4.0.0-beta-22816.nupkg",
"System.Console.4.0.0-beta-22816.nupkg.sha512",
"System.Console.nuspec",
"lib/aspnetcore50/System.Console.dll",
"lib/contract/System.Console.dll",
"lib/net45/System.Console.dll",

"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.Console.dll"
]
},
"System.IO/4.0.10-beta-22816": {
"sha512":
"PjyH9UMFVQHSl8g1XR+M6Q/mG2RTpPff42kG9aygXyR/Wyt/O/wOiyxZ2SaYNl8e86yecKRh9SnK2RS9thI4ig==",
"files": [
"License.rtf",
"System.IO.4.0.10-beta-22816.nupkg",
"System.IO.4.0.10-beta-22816.nupkg.sha512",
"System.IO.nuspec",
"lib/aspnetcore50/System.IO.dll",
"lib/contract/System.IO.dll",
"lib/net45/System.IO.dll",
"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.IO.dll"
]
},
"System.Runtime/4.0.20-beta-22816": {
"sha512":
"BEN6F4aNjbBdDxM8Xhb/MCSDhYmtvA29c1HUBvn0aNAVXaIJECLy2w5YkcscdklIieZCrcYeG2UzIgWlr4+GeQ==",
"files": [
"License.rtf",
"System.Runtime.4.0.20-beta-22816.nupkg",
"System.Runtime.4.0.20-beta-22816.nupkg.sha512",
"System.Runtime.nuspec",
"lib/aspnetcore50/System.Runtime.dll",
"lib/contract/System.Runtime.dll",
"lib/net45/System.Runtime.dll",

"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.Runtime.dll"
]
},
"System.Text.Encoding/4.0.10-beta-22816": {
"sha512":
"4Isk8Lg2mkSex8N1ufJfazDo9Z0zTvx7FRh7LYiIqUJJSmPMenMXoFYMtm3tQ+sUWz23qMlIrOvT9BuIBnmRQg==",
"files": [
"License.rtf",
"System.Text.Encoding.4.0.10-beta-22816.nupkg",
"System.Text.Encoding.4.0.10-beta-22816.nupkg.sha512",
"System.Text.Encoding.nuspec",
"lib/aspnetcore50/System.Text.Encoding.dll",
"lib/contract/System.Text.Encoding.dll",
"lib/net45/System.Text.Encoding.dll",

"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.Text.Encoding.dll"
]
},
"System.Threading.Tasks/4.0.10-beta-22816": {
"sha512":
"KhcVrI2JzX1oHigWTbf4F/2uhPSkhjquLPYbBVCLe9HGxLDJk2WLgmTbJk7fIus6xWWnWJmhOp0rHERU9M2SQw==",
"files": [
"License.rtf",
"System.Threading.Tasks.4.0.10-beta-22816.nupkg",
"System.Threading.Tasks.4.0.10-beta-22816.nupkg.sha512",
"System.Threading.Tasks.nuspec",
"lib/aspnetcore50/System.Threading.Tasks.dll",
"lib/contract/System.Threading.Tasks.dll",
"lib/net45/System.Threading.Tasks.dll",

"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.Threading.Tasks.dll"
]
},
"System.Xml.ReaderWriter/4.0.10-beta-22816": {
"sha512":
"Mx4PY22Xvz4u6h6A3yDNi8S7yvIh7yHSE9v0QM21d4cha2HMP5pwPdaKqCNkRytCQwKrBUFdMGQAmysF6n0K7w==",
"files": [
"License.rtf",
"System.Xml.ReaderWriter.4.0.10-beta-22816.nupkg",
"System.Xml.ReaderWriter.4.0.10-beta-22816.nupkg.sha512",
"System.Xml.ReaderWriter.nuspec",
"lib/aspnetcore50/System.Xml.ReaderWriter.dll",
"lib/contract/System.Xml.ReaderWriter.dll",
"lib/net45/System.Xml.ReaderWriter.dll",

"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.Xml.ReaderWriter.dll"
]
},
"System.Xml.XDocument/4.0.10-beta-22816": {
"sha512":
"6NwAYXuYtZtS6LSqXsMjafbVUnNWeqClza4qkfCehd2T0OdcwseTAN23IBL6ogumrjHFRdoomTFXTau4TVQCXg==",
"files": [
"License.rtf",
"System.Xml.XDocument.4.0.10-beta-22816.nupkg",
"System.Xml.XDocument.4.0.10-beta-22816.nupkg.sha512",
"System.Xml.XDocument.nuspec",
"lib/aspnetcore50/System.Xml.XDocument.dll",
"lib/contract/System.Xml.XDocument.dll",
"lib/net45/System.Xml.XDocument.dll",

"lib/portable-wpa81+wp80+win80+net45+aspnetcore50/System.Xml.XDocument.dll"
]
}
},
"projectFileDependencyGroups": {
"": [
"System.Xml.XDocument >= 4.0.10-beta-22816"
],
"DNX,Version=v4.5.1": [],
"DNXCore,Version=v5.0": [
"System.Console >= 4.0.0-beta-22816"
]
}
}

[image: Inline image 1] http://www.medullan.com Andrew Hall
Medullan Inc. | medullan.com http://www.medullan.com
t: +1 876 374 8032
e: ahall@medullan.com

On Mon, May 4, 2015 at 1:26 PM, David Fowler notifications@github.com
wrote:

Whats in your project.lock.json file


Reply to this email directly or view it on GitHub
#552 (comment).

@davidfowl
Copy link
Member

Looks legit. Are you missing the using statement in your code? using System.Xml.Linq;

@ahall-medullan
Copy link
Author

I think I had it before but i can double check... Its working, I think i
tried all of what you to do me to do before. good thing I wasn't arrogant
and tell you its not going to work. Thanks a million, now I can go create
some magic ;)

Respectfully,

[image: Inline image 1] http://www.medullan.com Andrew Hall
Medullan Inc. | medullan.com http://www.medullan.com
t: +1 876 374 8032
e: ahall@medullan.com

On Mon, May 4, 2015 at 1:48 PM, David Fowler notifications@github.com
wrote:

Looks legit. Are you missing the using statement in your code?


Reply to this email directly or view it on GitHub
#552 (comment).

@davidfowl
Copy link
Member

Another satisfied customer

@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants