Skip to content

Conversation

@stevenbrix
Copy link
Contributor

I'm trying to make our developer-guide and scripts more helpful for people new to the project. In doing so, I realized the -local to copy-wpf.ps1 isn't really helpful since the version of the Microsoft.WindowsDesktop.App runtime there is fairly old, and coincides with the version of the sdk defined in our global.json. In general, I feel like it's a better practice to use the dotnet-install script to create a dotnet install at a known location, then modify that install as you see fit. The local .dotnet folder should really only be used for automated testing and building our product, not modified for manual testing purposes. Since we don't build our tests against the Microsoft.WindowsDesktop.App runtime, copying our assemblies anywhere in that location doesn't even make sense anyways.

I ran into this issue trying to validate some changes against the large suite of our DRTs that aren't built out in the open yet.

@stevenbrix stevenbrix requested a review from SamBent June 12, 2019 21:28
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jun 12, 2019
@ghost ghost requested review from rladuca, ryalanms and vatsan-madhavan June 12, 2019 21:28
@stevenbrix
Copy link
Contributor Author

stevenbrix commented Jun 17, 2019

@SamBent i know you've experienced some frustration around the developer-guide and how to get started. do these changes help clear things up?

@stevenbrix stevenbrix merged commit 9c4c3b5 into master Jun 18, 2019
@dotMorten
Copy link
Contributor

@stevenbrix is this part of also addressing the issue I mentioned last week that I'm still having ? (App crashes before even getting running)

@dotMorten
Copy link
Contributor

When I try and run this script after a build -pack it fails :

e:\GitHub\dotnet\wpf>md c:\testhost\x86

:\GitHub\dotnet\wpf>dotnet --version
3.0.100-preview6-012264

e:\GitHub\dotnet\wpf>powershell -ExecutionPolicy ByPass -NoProfile -command "eng\copy-wpf.ps1 -testhost -destination c:\testhost\x86
Resolve-Path : Cannot find path 'C:\testhost\x86\shared\Microsoft.WindowsDesktop.App' because it does not exist.
At E:\GitHub\dotnet\wpf\eng\copy-wpf.ps1:92 char:21
+ ... $location = Resolve-Path (Join-Path $destination "shared\Microsoft.Wi ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\testhost\x86...dowsDesktop.App:String) [Resolve-Path], ItemNotFoundE
   xception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand

Copying binaries to dotnet installation at
Location unavailable:```

@stevenbrix
Copy link
Contributor Author

stevenbrix commented Jun 19, 2019

@dotMorten no it doesn't unfortunately. still looking into that, i'll let you know when we have that figured out.

copy-wpf.ps1 assumes you already have a test host installation of dotnet setup on your machine. at the minimum it should probably provide better information.

This is the script I have locally that i use to install dotnet either to program files or my testhost location:

Param(
[switch]$testhost,
[string]$version="latest"
)

$dotnet_install= Join-Path $PSScriptRoot "dotnet-install.ps1"
$x64InstallDir= if ($testhost) {"c:\testhost\x86" } else { "$env:ProgramFiles\dotnet"}
$x86InstallDir= if ($testhost) {"c:\testhost\x64"} else { "${env:ProgramFiles(x86)}\dotnet" }

Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile $dotnet_install

.$dotnet_install -Channel master -Version $version -Architecture x64 -InstallDir $x64InstallDir
.$dotnet_install -Channel master -Version $version -Architecture x86 -InstallDir $x86InstallDir

I'll add this to the repo and update the scripts to add better information (or feel free to do so if you are so inclined)

@stevenbrix stevenbrix deleted the dev/stevenbrix/updateDeveloperGuide branch June 20, 2019 20:21
@ghost ghost locked as resolved and limited conversation to collaborators Apr 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants