Home General
Options

Certain resource files are not being put in output directory

edited June 24 in General

I'm trying to script up a small test program to test some API clients I wrote up and requires some external resources to run. In this case, certificate files.

I've added the file I needed as a reference and made sure to "Copy all assemblies and native libraries into local output folder" to run it. Problem is, it's not copying one specific file over for whatever reason. Other files seem to copy over fine.

I specifically need jeff.dev_aus.cert.pfx but it's not being copied. The marked over files also copied over fine. As a test, I imported a separate pfx file to rule out any special logic for pfx files but that copies over fine as well.

What's happening here? Are there any restrictions on what can be added as references?

Happens in both LINQPad 8 and 9.

Comments

  • edited June 24

    Could it be that jeff.dev_aus.cert.pfx is:

    • owned by more privileged user.
    • has Encrypted attribute (not sure if * it prevents from copying).
  • I have full ownership over all the files, I have created them. They all also have the same exact attributes and permissions (the usual basic attributes and whatnot).

  • Try cloning the script (Ctrl+Shift+C) and running it again. Any warnings generated by copying files should then be reiterated.

    Also, see whether you can programmatically copy the file to the output folder.

  • @JoeAlbahari said:
    Try cloning the script (Ctrl+Shift+C) and running it again. Any warnings generated by copying files should then be reiterated.

    Also, see whether you can programmatically copy the file to the output folder.

    The script is saved, but cloning it doesn't work either. As far as I know, there's no errors reported by LINQPad.

    I have been able to copy the files programmatically no problem both to an arbitrary folder (TEMP) and the script's working directory.

  • edited June 25

    Lines 7, 12 - source file full path.
    Line 17 - source file path only.

  • @i2van said:
    Lines 7, 12 - source file full path.
    Line 17 - source file path only.

    Yes, just demonstrating that the expectation that LINQPad ought to be copying the file over to the working directory since it was added as a reference (but fails).

  • edited June 26

    I created a script to replicate the conditions here: https://share.linqpad.net/ws7ndip4.linq

    I've been playing around with the file names and for some reason, jeff.dev_aus.cert.pfx does not get copied over. I'm wondering if it's something specific to my machine that's preventing it from being copied? I'm going to try running this at home and report here.

  • edited June 26

    Interesting, I'm at home and I'm getting exactly the same result I did at the office. It can't be something to do with the contents of the files, the repro script makes empty files, it's all dependent on the name.

    I wonder if part of the name is reserved or something preventing it from being copied?

    Maybe the combination of "dev...cert.pfx"? Doesn't explain why jeff.dev_aus.something.cert.pfx copies fine.

  • edited June 26

    Remove the reference to jeff.dev_aus.cert.pem, and it works.

    It does not seem to like two files with the same root name but with different extensions.

  • Ah ok. An oversight surely. There are many situations where files can differ only by the extension. I can workaround in the meantime and hope this gets fixed soon.

  • There are many situations where files can differ only by the extension

    Especially dlls and pdbs which I've used a lot but I'm not sure if I have ever had to do so with shadowing.

  • This is now fixed in 9.1.4. Let me know if it works for you and I'll backport the fix to 8.x.

Sign In or Register to comment.