0

I am new to Sitecore and Glass.Mapper tools. I am working with Visual Studio 2013 and Sitecore 8.1 for a solution I have begun working on (not the author).

Due to other questions I have observed, I will try to demonstrate what my solution now has in it to remove build errors.

My packages.config includes the following:

<package id="Glass.Mapper" version="4.2.1.188" targetFramework="net45" />
<package id="Glass.Mapper.Sc" version="4.2.1.188" targetFramework="net45" />

My nuget.config includes the following:

<?xml version="1.0" encoding="utf-8"?>
  <configuration>
  <solution>
    <add key="disableSourceControlIntegration" value="true" />
  </solution>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
  <packageSources>
    <add key="nuget v2" value="https://www.nuget.org/api/v2" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

I have added these as project references to each of these Dlls from our Packages directory, which also includes the following in a few of the projects:

  <package id="Glass.Mapper.Sc.CastleWindsor" version="3.3.0.25" targetFramework="net45" />
  <package id="Glass.Mapper.Sc.Core" version="4.2.1.188" targetFramework="net45" />
  <package id="Glass.Mapper.Sc.Mvc-5" version="3.3.0.45" targetFramework="net45" />

Solution errors have been reduced from several hundred to ~20, mostly due to this issue, and the Metadata file "..." could not be found errors which appear since dependent projects fail to generate their project Dlls.

We cannot upgrade Nuget in place, and we cannot perform upgrades using Manage Nuget Packages for Solution due to code in place which references deprecated methods in key packages.

halfer
  • 19,824
  • 17
  • 99
  • 186
Taersious
  • 751
  • 9
  • 20
  • unrelated to your question, but having both the NuGet v2 and v3 feeds in your package sources will make your restores slower with no benefit. I highly recommend you delete the v2 api feed from the nuget.config. – zivkan Jun 21 '19 at 22:54

1 Answers1

0

If you browse packages on nuget.org with your web browser, you can guess the pattern for viewing a specific version of a package. So, version 4.2.1.188 of GlassMapper will use the URL https://www.nuget.org/packages/Glass.Mapper/4.2.1.188

There, I see a message saying

The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore.

So the package exists, so existing packages should be able to restore it, but the owner has delisted it to reduce the probability that new projects will start using it. Interestingly the package owner has delisted all versions of the package, suggesting the package is deprecated.

Anyway, as I mentioned, normally the package can still be restored (that's the point of unlisting vs deleting). So my best guess is that the version of NuGet that works with Visual Studio 2013 doesn't support unlisted packages as it's really, really old.

You could download nuget.exe from nuget.org/downloads, restore from the command line and then use Visual Studio. Otherwise you'll probably need to upgrade to a newer version of Visual Studio.

zivkan
  • 12,793
  • 2
  • 34
  • 51
  • Thanks. We are currently stuck with VS 2013, and the solution is using an extremely old version of Nuget. Additionally, the projects cannot be upgraded above .Net 4.5. All of this has caused undue hardship and the waste of many man-hours. So then do you recommend I remove my package reference and add the DLLs manually in the \bin since we have already implemented this version of Glass.Mapper? – Taersious Jun 24 '19 at 14:06
  • you could just copy the packages to a private nuget feed and use a `nuget.config` file to use that feed for your solutions. I probably should have remembered/suggested that when writing the answer. – zivkan Jun 24 '19 at 14:27