We have several projects that we use in most all of our projects. We are wanting to move them to a private NuGet store. We have installed NuGet.Server and have it working with our .net framework versions of the projects. We also have most of these common projects that we need to use in .net core projects, so our team has created core versions. When I try to publish the core version of the package to the NuGet, it does not really differentiate between the core and .net FW versions, that is when we try to consume the packages from the store on a project that is based on core, it show both versions of the package, instead of just the version for core. Is this something that we deployed incorrectly or are there other issues that we don't know?
Any insight would be appreciated.
We fixed the majority of the issues we had, including loading of symbols, using BaGet version of nuget server. It is available on Github
Related
I was looking for some NuGet updates about my project libraries. I see that there are a lot of Microsoft libraries update to v5.0.0.
Based on my knowledge I think these are new dependencies released with .Net 5.0 and I'm not sure that I can update these libraries to latest version using .Net Core 3.1 project.
Can I update to v5.0.0 libraries even if I'm using/building a .Net Core 3.1 project?
Unfortunately, you cannot update many of these newest Nuget packages to 5.0. The reason being is that the newest Nuget package versions are written primarily for .NET 5, and often times Nuget Package Manager will even prevent you from installing them since there are differences in the APIs. With that said, there may be a few spots where it will allow the installation, but I wouldn't recommend it if you plan to keep the application on .NET Core 3.1. Most likely it could cause some inconsistencies that would be hard to debug. Proceed with caution, or upgrade your projects to .NET 5.
I just finished the same. I had 3.1 core application with a lot of 3.1 and NET Standard2.0 libraries projects and just updated all these libraries to the version 5. All libraries were working ok, I could compile them. But I couldn't compile my main Web application. It started to give some strange errors that some staff needs .net5. Maybe it could be fixed but I didn't see much sense to waste my time since in any case I was planning to move to net5 in a couple of days. So I just decided to move to net5 immediately. I had installed net 5.0 SDK and change target framework of my application to net5.0. Now everything is working fine and I am happy with my net5.0 application. I have some Net 4.8 projects that use the same common libraries that I am using for Net Core. So these common libraries are targeted to netstandard2.0. and can't change them to Net5. Now all these Standard2.0 projects still work with my net5.0 web application without any problem. Since I didn't have any problems with my previous version 3.1.9 I DON'T RECOMEND to update libraries to 5.0 if YOU DON'T PLAN to move your application to Net5.0. You can get more problems after this then you can gain from this update.
You should report such (VS for Mac and VS for Windows) as product defects to Microsoft, as many of the new 5.0 packages are targeting net5 solely, and not applicable to netcoreapp3.1.
Try to use outdated tool to check package updates, which is much more reliable,
https://github.com/dotnet-outdated/dotnet-outdated
I built an application with target framework .NET 4.6 using MVC 5 and Entity Framework 6 using Visual Studio 2017 on my Windows 7 machine. I'm now being told that I should have built the application to target .NET 4.0 because the production environment only has 4.0 installed. So I changed the target framework to 4.0 but now the application will not build on my machine.
I'm guessing I also need to downgrade MVC and EF. How is the proper way of doing this?
And which versions of MVC and EF should I install?
Do I need to make any manual changes to web.config?
There is no "proper" way, you have 3 options, in my favorite order:
Update the server and install the latest .net version. (at the time .net 4.6). Make sure used libraries are up to date and not end of life.
Start over in a new project and make sure you target version 4.0: you can copy most of your source files. You'll probably get some compiler errors, but usually they are easily fixed. This way you'll have the benefit that the used template matches the framework and packages version(s).
Re-target the used framework in the project properties and replace the packages which are installed and hope for the best (sometimes you need other packages). Hopefully you used the package manager to install those packages. Maybe the update-packages command helps, but be sure to backup your project first. Some packages become obsolete after time, some are renamed. This is what will cause issues. Also, some of the Methods/API calls will be different, so some rework will be needed.
As for the rest of your questions:
I'm guessing I also need to downgrade MVC and EF. How is the proper way of doing this?
Use the nuget package manager
And which versions of MVC and EF should I install?
The nuget package manager will fix this for you.
Do I need to make any manual changes to web.config?
Sometimes: yes.
The NuGet.Server package is used to create a ASP.NET MVC NuGet server and it works just fine. There is another package NuGet.Server.Core that is expected to do the same when hosted within a ASP.NET Core (perhaps 1.0 or 1.1?).
The first one creates 'Packages' folder right beneath the main folder used as a package repository.
No such things happens after installing the Core version. I tried both root and a dedicated folder. Googling a bit, I found no info about installing the package and integrating it in a ASP.NET Core app.
Has anyone succeeded in installing the Core version? Also, there's another version NuGet.Server.V2 which depends on NuGet.Server.Core, however it requires .NET Framework 4.6.1. This makes me think that NuGet.Server.Core is not targetting .NET Core at all.
If so, the name must be somewhat misleading, I guess...
Yes, this is the answer:
No .NET Core whatsoever! Just .NET Framework 4.6.1. Not a big discovery but a warning to all devs who, like me, were (and, more importantly, will be!) misled by 'Core' in the package's name.
Here's a 3rd party option (free)
https://github.com/loic-sharma/BaGet
Nuget.Server.Core seems to be one of the dependencies of Nuget.Server. So it's not a .NET Core project. Guess that's one of those snags you run into when you call your framework "Core". :)
I think you can use BaGet.
There is my article about that.
Check this :
Create your own NuGet server and package feed
I created an empty ASP.NET 5 to work with .NET Core. I am trying to add MVC package to the application but I am receiving an Error that the Versions are not compatible, although I tried lots of MVC versions.
Anyone has an idea about the problem? thank you!
You need Nuget packages in the Microsoft.AspNetCore.Mvc namespace. You're currently trying to install Microsoft.AspNet.Mvc 5.2.3, which is the traditional MVC package and only works with full .NET.
If you're working with .NET Core you should be using Microsoft.AspNetCore.* packages. (Microsoft.AspNet.* packages target the full .NET framework.)
Your screenshot shows a dependency on DNX. You do realize that's a pre-release technology? I don't mean to be rude but I'm curious as to why you would be targeting the pre-release framework rather than RTM (which has been available for several months).
If you do want to work with the prerelease bits, you may need to tweak your NuGet feeds to be able to see the appropriate .NET Core packages (I definitely had to do this when working with .NET Core betas).
I'm working in Visual Studio 2015 Update 3 and .NET Core 1.0. I have a Web API project which is of type .NETCoreApp v1.0. When I add a .NET Core class library, it is of type .NETStandard v1.6. I can add this library to the Web API project as a reference, but it is not recognised when I try to add using statements.
If I create another project of type .NETCoreApp, I can reference it and use the classes without a problem.
How do I make use of a .NET Core class library from my .NET Core App?
Edit/Update:
This appears only to be an editor/Intellisense issue, because despite the editor warnings, the .NETCoreApp does build and run, calling into the class library.
I am running Resharper, which I see is blamed for similar problems with other types of projects: I have checked that I have the latest version and have cleared the Resharper cache and restarted VS2105.
This is a Resharper issue. At this time Resharper (v2016.1.2) does not support .NET Core 1.0.
There are 2 possible solutions:
Uninstall Resharper, and the Visual Studio native intellisense works.
Install the Resharper 2016.2 EAP (Early Access Program) version. I've done this and it's working. Obviously it comes with the caveats of any EAP/beta product.
Here is a link to the Jetbrains forum post where I was told .NET Core 1 was not yet supported and pointed to the EAP version.
Once you've built a library that targets netstandard1.X, you can either:
Produce a NuGet package with dotnet pack and host it locally or on NuGet. Then, install it in your netcoreapp project as any other dependency.
If your library and application are part of the same solution, make a local reference:
project.json
"dependencies":{
"MyLibrary.Core": {
"version": "1.0.0",
"target": "project"
}
}
target: project tells dotnet to look in the current solution for the dependency, instead of using your NuGet feeds. Again, this only works if you are developing the library and application in the same solution.