Replace asp.net core NuGet packages with local dll files
use local nuget package
net core dll
local nuget repository
I am trying to get rid of nuget packages and have only local dll files in the project.
These packages I have excluded
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" /> <PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
So, I've built my solution and imported all the dlls in the project. I can compile it, but the server says:
An unhandled exception occurred while processing the request. InvalidOperationException: The view 'Index' was not found. The following locations were searched: ...
But having the same with nuget makes the work fine. What is an alternative to add dlls to the project?
I've seen this, but in my case I have too many files with the same name when I put all the dlls in one folder (conflicts)
You can always add NUget source which is local folder from you drive and make it as default or the only source of dependencies.
Here are more details Local feeds
Debugging a NuGet Package with a Locally-built DLL & PDB, NET project, but no source or symbol files. If you need This is a short guide to debugging a NuGet package by replacing it with a local build. To promote a cleaner development environment and to reduce repository size, NuGet Package Restore installs all of a project's dependencies listed in either the project file or packages.config. The .NET Core 2.0+ dotnet build and dotnet run commands do an automatic package restore.
Replace asp.net core NuGet packages with local dll files. What is an alternative to add dlls to the project? I am trying to get rid of nuget packages and have only local dll files in the project.
Nuget is a recommended way to manage the assemblies for your project. When you have access to Internet, using nuget is very convenient for your situation.
But according to your another post here, you're trying to develop/build the project in environment with no Internet. If so, we can still use nuget for this situation:
Step1: Clear all Nuget cache in VS=>Tools=>Options=>Nuget Package Manager=>General. (All packages you once used in VS are cached in
%userprofile%\.nuget\packages, we can easy to restore the packages using
nuget store, so feel free to clear the cache)
Step2: Delete the
bin and obj folders of your current web project, and then restore packages for only your current project.(nuget restore, dotnet restore or simply rebuild the project in VS,VS will restore the packages for you)
Step3: Now let's navigate to the
%userprofile%\.nuget\packages folder, now every packages in
packages folder is that your current project depends on. Let's rename the folder name from
mypackages. Now all the packages(assemblies) your project need are in
Step4: We can then copy/move this folder into your project folder. We can add this folder into source control or what depending on your actual needs. You can feel free to deploy your project to another server(no-internet) and continue on your work.
As to how to reference them, you can fetch the assemblies you need from
mypackages folder and manually reference them.(Add=>Reference=>...). Or use this better way with nuget, add the path where your
mypackages folder exist to Package Source, you can restore the packages for your project easily even in no-Internet environment.
Hope it helps and feel free to let me know if you need any further info or support :)
Referencing a .NET DLL directly, using the .NET Core toolchain, NET Core was a breath of fresh air and along with it came some The PackageReference and ProjectReference tags allow you to specify a NuGet package and project dependencies respectively. NET assembly “MyLibrary.dll” sitting somewhere on my file system Hosting a background task in an ASP. To upgrade an existing ASP.NET Core 3.0 Preview 8 project to Preview 9: Update all Microsoft.AspNetCore.* package references to 3.0.0-preview9.19424.4; In Blazor apps and libraries: Add a using statement for Microsoft.AspNetCore.Components.Web in your top level _Imports.razor file (see Blazor event handlers and data binding attributes moved to
Probably missing a reference to
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation. You can add a dll for this package and then compile the Project or solution.
Include both Nuget Package References *and* project reference , CSProj Snippet of dotnet core project Now if you run dotnet pack you should see any project reference DLL under of the package, and if you inspect the nuspec file inside the package (or 'ProjectReference')->Replace('.dll', '.xml'))" Using Docker Containers for easy local WordPress development . Copy file between a local computer and remote servers using FTP, FTPS, SCP, SFTP, WebDAV or S3 file transfer protocols. WinSCPNet.dll not found when executing in an ASP.NET Core 2.0 , Tried installing nuget v5.9.4 in a .net core class project, error: Package restore failed. Rolling back package changes Is there a plan to make a The WinSCP .NET
Create a NuGet package using nuget.exe CLI, NET Core and . Technically speaking, a NuGet package is just a ZIP file that's been NET Standard projects using Visual Studio 2017 and higher versions For example, if you have a Utilities.dll that depends on Parser.dll on your local file system, then create the .nuspec file directly from that structure. The installer will automatically create a local feed named “Infragistics (Local)”, which will display all the ASP.NET NuGet packages that are available. During the installation if you leave the product key field empty, the installer will install the trial version of the packages.
Reinstalling and Updating NuGet Packages, Details on when it's necessary to reinstall and update packages, as with broken ASP.NET � SQL Server � Enterprise Mobility + Security � Microsoft Surface In a similar scenario, you can restore packages with the dotnet CLI. Project is broken due to deleted files: NuGet does not prevent you from� NuGet adds and manages DLL files in your .NET project, but not any source or symbol files. This can make debugging packages without extra tools like ReSharper rather challenging, since you’re basically left analyzing the source code without stepping through it at runtime.
.NET Core DLL Hell Is Here. Can .NET Core 2.0 Save Us?, NET Core DLL hell problem and show you how .NET Core 2.0 Back then it was more of an issue with registering COM DLL files. Fast forward to It has a couple of simple classes in it that are used by an ASP.NET Core NET team has a v4.6 dll in a v4.3 nuget package that is really v4.1.1. I can only� One of the promises of .NET, when it came out 15 years ago, was eliminating DLL hell.Back then it was more of an issue with registering COM DLL files. Fast forward to today and the world of mixing .NET Core, .NETStandard and .NET Framework projects have brought a whole new DLL hell.
- From the error specified it sounds like you are missing a
cshtmlfile? In your project have you got a
- It is there, it works. Until I remove these package references and put the dlls from the build folder.
- Some NuGet packages add important elements into your project file with special build instructions for things like MVC Views. I would look carefully through the XML of your project file and see if something there is trying to reference the packages folder still. On another note: this feels like you're working against the flow of technology's progress, which usually ends up being the wrong decision. Have you considered whether this is an "XY Problem," where you're asking about the solution but you've already chosen the wrong solution for the underlying problem you're trying to solve?
- Regarding your comment below that you're doing this because apparently your build server does not support restoring from NuGet: Get that fixed instead of trying to work around it - you do not want to have to check in all your dependencies in binary form (or have to rely on recreating folder structures on your build server).
- To back-up what @StriplingWarrior and germi said--you are trying to fix the wrong problem. You should get your build server working with NuGet, and not get rid of NuGet instead.
- I need to avoid the use of nuget because of our build server
- Local Nuget can point to relative path. Which will work both on build server and local. If you have everything in repo
- @mognurodro A build server not capable of handling nuget is basically broken. You need to get another one or fix it. Having local repos can still be helpful (saved my skin once) but your focus should be on that issue.