locked
How to load files from a local path into a project? RRS feed

  • Question

  • User2142845853 posted

    Using c# asp.net Webforms project, am compiling the files like IdentityManager  https://www.scottbrady91.com/ASPNET-Identity/Identity-Manager-using-ASPNET-Identity  

    things like System.Owin, System.Autofac and the others that end up in the References, how to load these directly instead of in the cloud from Nuget?

    You can download the files or get them from Nuget, if downloading from Github how do they become part of the project?  thought I was doing it right until finding errors in the Version and GUID; 

    thanks

    Thursday, January 3, 2019 9:20 PM

Answers

  • User-943250815 posted

    With Nuget you install/remove a selected package and all dependencies.
    On Visual Studio go to Tools > Nuget Package Manager > Manages Packages for Solution, when there you can Browse, Search, Install, Remove any package you want, if you select a packge to install it will be downloaded and installed and ready to use

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2019 9:34 PM
  • User753101303 posted

    Hi,

    If installed using nuget, nuget should be able to download them again as needed when transfering your project to another machine. They are registered in the packages.config file. As often it could be best to tell exactly which kind of "version and guid errors" you have so that we can better understand first which exact error you have.

    I'm not sure it should create some kind of "guid issue". If the project doesn't even load it could be that this type of project (identified with a guid) is not installed yet in VS.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2019 10:28 PM
  • User36583972 posted


    Hi rogersbr,

    things like System.Owin, System.Autofac and the others that end up in the References, how to load these directly instead of in the cloud from Nuget? 

    Usually, we can use the Package Manager Console and invoke the Install-Package cmdlet by specifying the path to the directory that contains the package file in the -Source parameter:

    For example: Download your nupkg file in a local folder. Then, install it.

    Install-Package D:\NugetFile\microsoft.bot.client.0.1.0-beta.nupkg

    I dont want Nuget here because the files being used, well one of them, was modified and built into a dll/pdb so the project needs to use my customized ones from the project linked before.  I only wished they used webforms pages but dont.   so the GUID errors, when I add in the modified IdentityManager.dll it stops and says cant find ...dll version 5234, expected some other file. etc. it depends how they package nuget files

    When you change a file in a library, the validation between all of their libraries may be corrupted.

    Best Regards,

    Yong Lu



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 7, 2019 7:50 AM
  • User753101303 posted

    Then it should be likely part of your main project. It is not uncommon to provide parameters or to inherit from a class to have most of the code in an external DLL and still be able to customize the behavior from the main project.

    Also you could use https://docs.microsoft.com/en-us/nuget/hosting-packages/overview to publish your own nuget packages at a private location and use them accross projects.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 7, 2019 8:44 AM

All replies

  • User-943250815 posted

    With Nuget you install/remove a selected package and all dependencies.
    On Visual Studio go to Tools > Nuget Package Manager > Manages Packages for Solution, when there you can Browse, Search, Install, Remove any package you want, if you select a packge to install it will be downloaded and installed and ready to use

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2019 9:34 PM
  • User753101303 posted

    Hi,

    If installed using nuget, nuget should be able to download them again as needed when transfering your project to another machine. They are registered in the packages.config file. As often it could be best to tell exactly which kind of "version and guid errors" you have so that we can better understand first which exact error you have.

    I'm not sure it should create some kind of "guid issue". If the project doesn't even load it could be that this type of project (identified with a guid) is not installed yet in VS.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2019 10:28 PM
  • User2142845853 posted

    Yes, Nuget is great because all the dependencies are managed for you.  but in my case I am building/compiling the files (dll's) and others and trying to include them in the project.

    I think the way to do it is one by one by going into references and doing browse and loading up all 40 or so files.  if I go into Nuget package manager and change the path to point to these files? they refuse to load because they dont have the versioning info with them.

    There is one main file, identitymanager that I modify and recompile into a .dll but if I drop that in? it crashes and says no, the version and GUID dont match what it expects. so the question is how to add all these files into the project

    thanks

    Friday, January 4, 2019 4:04 AM
  • User2142845853 posted

    I dont want Nuget here because the files being used, well one of them, was modified and built into a dll/pdb so the project needs to use my customized ones from the project linked before.  I only wished they used webforms pages but dont.   so the GUID errors, when I add in the modified IdentityManager.dll it stops and says cant find ...dll version 5234, expected some other file. etc. it depends how they package nuget files

    Hi,

    If installed using nuget, nuget should be able to download them again as needed when transfering your project to another machine. They are registered in the packages.config file. As often it could be best to tell exactly which kind of "version and guid errors" you have so that we can better understand first which exact error you have.

    I'm not sure it should create some kind of "guid issue". If the project doesn't even load it could be that this type of project (identified with a guid) is not installed yet in VS.

    Friday, January 4, 2019 4:09 AM
  • User36583972 posted


    Hi rogersbr,

    things like System.Owin, System.Autofac and the others that end up in the References, how to load these directly instead of in the cloud from Nuget? 

    Usually, we can use the Package Manager Console and invoke the Install-Package cmdlet by specifying the path to the directory that contains the package file in the -Source parameter:

    For example: Download your nupkg file in a local folder. Then, install it.

    Install-Package D:\NugetFile\microsoft.bot.client.0.1.0-beta.nupkg

    I dont want Nuget here because the files being used, well one of them, was modified and built into a dll/pdb so the project needs to use my customized ones from the project linked before.  I only wished they used webforms pages but dont.   so the GUID errors, when I add in the modified IdentityManager.dll it stops and says cant find ...dll version 5234, expected some other file. etc. it depends how they package nuget files

    When you change a file in a library, the validation between all of their libraries may be corrupted.

    Best Regards,

    Yong Lu



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 7, 2019 7:50 AM
  • User753101303 posted

    Then it should be likely part of your main project. It is not uncommon to provide parameters or to inherit from a class to have most of the code in an external DLL and still be able to customize the behavior from the main project.

    Also you could use https://docs.microsoft.com/en-us/nuget/hosting-packages/overview to publish your own nuget packages at a private location and use them accross projects.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 7, 2019 8:44 AM