简体   繁体   中英

Unable to Add NuGet Packages to References in Monodevelop 5

I recently got Monodevelop 5 up and running from the ermshiperete repository and got NuGet working only after changing the source URL for the gallery to point to a "go link" that uses API version 1.

After installing the latest versions of 'Entity Framework' and 'Microsoft ASP.NET MVC', I see they were added to my packages, which is cool and all, but I need them added to my references for things to work right? Well, I cannot add them to my project's references. When I 'edit references' it does not display them, it only displays packages that I believe already come with the mono installation. I cannot add Entity Framework or Microsoft ASP.NET MVC.

How can I add packages I install to my references?

Can provide screen shots to explain better, perhaps.

Thanks!

EDIT: Here are links to screenshots

References From Packages

Some of the packages

Also some background here is that I am new to .NET development, and have been working on this project in VS on a VM, but I would rather just use my normal OS.

So I am assuming you used the Add Packages dialog in MonoDevelop 5 to add the NuGet packages to your project and that worked. So you see a packages.config file in your project and the packages inside a Packages folder in the Solution window.

Now the assembly references, if there are any defined in the NuGet package, are automatically added to your project when you add the NuGet package. You should be able to see them inside References/From Packages in the Solution window. The screenshot below shows ASP.NET MVC NuGet package and the Entity Framework NuGet package installed.

“解决方案”窗口中的包和包中的引用

So you should not need to use the Edit References dialog for assembly references that are included in the NuGet package but only for other references from the GAC or to reference another project. When you open the Edit References dialog the assembly references from the NuGet package are shown on the right hand side of that dialog in the Selected References section.

I think OP is a little unclear as to what specific problem he/she having. I'm guessing (since they were using entity framework) that they are somewhat experienced and has used packages before.

Had similiar and maybe same problem where it will report missing assemblies ('are you missing an assembly reference or using statement?' error), even when the correct assemblies are successfully loaded as packages.

In this case I believe it may have happened because the location of the solution file was moved in the repo, which screwed with the package restore paths. You can confirm this by looking at verbose debug logs in monodevelop or msbuild/.net core.

Or you can just delete the packages and re-add them, which is probably the fastest way.

It should be noted that matt_ward's post and screenshot above is what the "refences from packages" looks like visually in the IDE in normal/good situation.

Relative to this good situation- in my case when this stopped working, I had the packages in the packages part... but no "references from packages" section.

Delete and re-add packages or double-check paths in packages.config (located in same directory as the project file in question). Works again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM