tag:help.appveyor.com,2012-11-13:/discussions/problems/21988-multiple-solutions-can-second-solution-access-the-artifacts-of-the-previous-solutionAppVeyor: Discussion 2019-05-14T21:01:00Ztag:help.appveyor.com,2012-11-13:Comment/470422442019-03-07T05:41:02Z2019-03-07T05:41:02Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Here is <a href="https://gist.github.com/IlyaFinkelshteyn/79af78657660e118b15d3ab9d62ab8a1">a script</a> for sharing artifacts between jobs.</p>
<p>Let us know if you need some guidance adapting it to your particular project.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-07T18:42:11Z2019-03-07T18:42:11Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Thanks! How do I get the <code>secure:</code> version of the API key to put in the script?<br>
I see there's an API key for NuGet packages under the project, and one for the account. Should I use one of these? Will these work for all artifacts, or just NuGet packages? (I need to include the dll generated by the first build, which isn't in a NuGet package)</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-07T20:28:22Z2019-03-07T20:28:22Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Go to <strong>Account settings -> Encrypt YAML</strong> and encrypt your api key.<br>
Should work for any artifact.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-07T21:25:36Z2019-03-07T21:25:38Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Thanks. Now I'm getting this error from the first if statement:<br>
<code>While scanning a simple key, could not find expected ':'.</code></p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-07T22:41:54Z2019-03-07T22:41:56Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>hmm so that turned out to be a weird yaml error which was fixed when I just changed the order of the blocks :S</p>
<p>now the build script is running, but I'm getting this error when it reaches the Invoke-RestMethod</p>
<pre>
<code>Invoke-RestMethod : {"message":"User must be logged in to access account resources."}
At line:16 char:16
+ ... $project = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/proje ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException</code>
</pre>
<p>I think I am logged in? Maybe I need a different API key?</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-08T00:47:35Z2019-03-08T00:47:38Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>hmm so I found the right API key and it seems to be connecting, but I'm getting a 401 not authorized error.</p>
<p><code>Start-FileDownloadInternal : Error downloading remote file: One or more errors occurred. Inner Exception: Remote server returned 401: Unauthorized At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:242 char:2 + Start-FileDownloadInternal -Url $Url -FileName $FileName -Timeout ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Start-FileDownloadInternal], Exception + FullyQualifiedErrorId : System.Exception,Appveyor.BuildAgent.Api.Utils.StartFileDownloadInternalCmdlet</code></p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-08T16:29:21Z2019-03-08T16:29:21Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Can you share your configuration in yaml format.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-08T19:20:12Z2019-03-08T19:20:14Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Here it is</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-08T19:23:52Z2019-03-08T19:23:53Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>oops, was on another branch; here's the right one</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-09T07:13:55Z2019-03-09T07:13:55Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>The <code>Start-Filedownload</code> cmdlet parameter looks wrong. I think it needs to have <code>$jobToWaitId</code> variable in it.<br>
As per the example given...<br></p>
<pre>
<code>Start-FileDownload https://ci.appveyor.com/api/buildjobs/$jobToWaitId/artifacts/<path-to-your-artifact></code>
</pre></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-12T00:02:47Z2019-03-12T00:02:49Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>I get the same unauthorized error with that.</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-12T00:29:58Z2019-03-12T00:30:01Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>The API key I'm using is the one from under My Profile, when I set the dropdown to my unique user name. Is that the API key to use for this?</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-12T03:51:58Z2019-03-12T03:51:58Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Sorry, I should have noticed... <code>Start-FileDownload</code> cmdlet won't work here since you are trying to access a private repo.</p>
<p>You'll need to translate that call into another api call with a header containing your key.<br>
Everything else looks good.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-12T18:26:17Z2019-03-12T18:26:18Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Yay thanks, finally got both parts of the build working today!</p>
<p>The last thing I need to do is get the unit tests actually logging. I tried adding a <code>vstest.console</code> line under <code>test_script:</code>; I'm not getting any errors right now, but I'm also not seeing any logs appear in the Tests tab for the project.<br>
Could you tell me if there's anything I'm doing wrong here?</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-12T19:37:54Z2019-03-12T19:37:54Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Since you are using <code>test_script</code> instead of automatic testing, you should output test results to xml and upload that file. You can read about that approach <a href="https://www.appveyor.com/docs/running-tests/#uploading-xml-test-results">here</a>.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-13T21:26:38Z2019-03-13T21:26:39Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>hmm so it turned out I had some other stuff in that yaml that was preventing the build from working correctly. I fixed that, and it currently seems like:<br>
1. The build artifacts (dll) gets created<br>
2. It gets downloaded to the second project<br>
3. The second project fails to find the dll and its build fails</p>
<p>at the moment, I think the issue might be that the dll needs to be in a specific path to be seen by the second project? Do you have any ideas for what might be going wrong?</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-13T21:40:10Z2019-03-13T21:40:11Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Is it possible that there's a better way of doing this? Could I just have both projects build in the same environment?</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T04:09:41Z2019-03-14T04:09:41Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Yeah, you could build both solutions in one project. Just abandon the build matrix you've made and call msbuild on each one in turn.<br>
Seems easier to me...</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T18:25:04Z2019-03-14T18:25:05Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Hmm ok I simplified it a bunch so they're both building in one project. Maybe this will work better.</p>
<p>However now I'm getting an error on the UnitTests project with "_TemporaryKey.pfx' not found". Do you know what causes this?</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T18:35:27Z2019-03-14T18:35:29Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>hmm I found another thread that showed how to encrypt the pfx and restore it in the appveyor yml file...<br>
Trying to figure out where to encrypt the file now...</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T18:42:08Z2019-03-14T18:42:09Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>hmm I found this page: <a href="https://www.appveyor.com/docs/how-to/secure-files/">https://www.appveyor.com/docs/how-to/secure-files/</a><br>
but not sure what the secret is that I should use to encrypt the file, so that it decrypts correctly...</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T19:52:50Z2019-03-14T19:52:51Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>omg I got it working!</p>
<p>Hmmm although, I'm not seeing it actually show me test results in the Tests tab.<br>
I get this console output though:<br>
Discovering tests...OK<br>
Build success</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T20:22:04Z2019-03-14T20:22:07Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>if you're using an appveyor.yaml file, are you required to do something special to trigger your tests? atm I'm not putting anything test-related in the yaml file, but I'm not seeing any tests show up in the console</p></div>Henry Schmitttag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T20:38:04Z2019-03-14T20:38:04Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>Looks like you gave your assembly a strong name and (perhaps wisely) did not check the key file into your repository.<br>
Maybe take a look <a href="https://docs.microsoft.com/en-us/dotnet/framework/app-domains/strong-named-assemblies#why-strong-name-your-assemblies">here</a> and decide if you really need the test assembly to have a strong name.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/470422442019-03-14T21:00:06Z2019-03-14T21:00:06Zmultiple solutions; can second solution access the artifacts of the previous solution?<div><p>You can run your own custom test scripts as you did in the previous <code>appveyor.yml</code> that you attached.<br>
But you should also be able to run tests in auto mode by pointing to the test assemblies as documented <a href="https://www.appveyor.com/docs/running-tests/#selecting-assemblies-andor-categories-to-test">here</a>.</p></div>Owen McDonnell