Source Only Nuget Package is not being found

d3labar's Avatar

d3labar

12 Aug, 2017 03:14 AM

I'm getting errors for https://ci.appveyor.com/project/daryllabar/dlab-xrm-xrmtoolboxtools.

Line 8 is Restoring NuGet package DLaB.Common.Sources.1.0.4.11.
But the first error is line 162 CSC : error CS2001: Source file 'C:\projects\dlab-xrm-xrmtoolboxtools\DLaB.CrmSvcUtilExtensions\App_Packages\DLaB.Common.Sources.1.0.4.11\ConfigKeyValueSplitInfo.cs' could not be found. That file exists in the DLaB.Common.Sources package...

  1. Support Staff 1 Posted by Ilya Finkelshte... on 14 Aug, 2017 08:35 PM

    Ilya Finkelshteyn's Avatar

    Correct me if I wrong, those CrmSvcUtilExtensions.cspro references assume that DLaB.CrmSvcUtilExtensions folder contains App_Packages sub-folder with all that content, right? I believe it exists on your local machine, but I cannot understand how it supposed to appear on build VM, if it does not exist in repo...

  2. 2 Posted by d3labar on 15 Aug, 2017 03:00 AM

    d3labar's Avatar

    DLaB.Common.Sources.1.0.4.11 is a source only NuGet Package (https://nikcodes.com/2013/10/23/packaging-source-code-with-nuget/). When I install it locally, it creates the files in the App_Packages sub-folder. I could deletethose files, and re-install the nuget package, and it would bring in the source files.

    I live in a world where I have to deploy everything to a sandbox environment where I can't reference external dlls, so rather than IL-Merging everything, source only nuget Packages are really nice.

    Thanks!

    Daryl LaBar

    ________________________________

  3. Support Staff 3 Posted by Ilya Finkelshte... on 16 Aug, 2017 03:37 AM

    Ilya Finkelshteyn's Avatar

    Sorry my ignorance. I see now. But if you look at logs nuget restores those sources to default packages folder: Adding package 'DLaB.Common.Sources.1.0.4.11' to folder 'C:\projects\dlab-xrm-xrmtoolboxtools\packages'. Maybe you have custom repositoryPath settings in packages.config on your machine?

  4. 4 Posted by d3labar on 23 Aug, 2017 12:47 PM

    d3labar's Avatar

    Um... When I run it on my local machine, it puts it in both places:

    https://www.screencast.com/t/yTbooiRiEv

    [https://content.screencast.com/users/D_La_B/folders/Snagit/media/536d787f-8e66-4e2d-b9b3-8b1c2dc2ab2d/FirstFrame.jpg]<https://www.screencast.com/t/yTbooiRiEv>

    SourcesOnyNugetPackageInstall<https://www.screencast.com/t/yTbooiRiEv>
    www.screencast.com
    Shared from Screencast.com

    Thanks!

    Daryl LaBar

    ________________________________

  5. Support Staff 5 Posted by Ilya Finkelshte... on 26 Aug, 2017 06:24 AM

    Ilya Finkelshteyn's Avatar

    Local machines with historical settings are always different from clean VM. I have very strong feeling that if you try to git clone and nuget restore on some another computer or VM you never sue before, you will see the same results as on AppVeyor. Can you try that?

  6. 6 Posted by d3labar on 26 Sep, 2017 08:32 PM

    d3labar's Avatar

    So... finally figured out what the heck is/was going on.

    A Nuget Restore, does not copy over content files, which the App_Sources is. So the source files are copied to the packages directory, but not to the actual project directory, unless you actual re-install the package.

    Incase someone else has the same issue:

    I ended up having to create an exe to perform the copy and potential transformation:

    https://github.com/daryllabar/DLaB.Xrm.XrmToolBoxTools/raw/master/References/NuGetContentInstaller.exe

    And then calling it from the Pre-Build of the project:

    "$(SolutionDir)References\NuGetContentInstaller.exe" "$(SolutionDir) " "$(ProjectPath)"

    Thanks!

    Daryl LaBar

    ________________________________

  7. Support Staff 7 Posted by Ilya Finkelshte... on 26 Sep, 2017 11:08 PM

    Ilya Finkelshteyn's Avatar

    Thanks a lot for the update!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Oct, 2017 08:54 AM
18 Oct, 2017 08:21 AM
18 Oct, 2017 07:42 AM
17 Oct, 2017 07:36 PM
17 Oct, 2017 05:39 PM

 

17 Oct, 2017 04:29 PM
17 Oct, 2017 07:49 AM
16 Oct, 2017 11:38 PM
16 Oct, 2017 10:01 PM
16 Oct, 2017 08:25 AM
16 Oct, 2017 07:58 AM