Commit 83c0088
committed
[wasm] Fix Publish for Blazorwasm projects on VS17
TL;dr `publish` fails on any blazorwasm project with VS17
A recent commit[1] moved initializing `$(_WasmIntermediateOutputPath)` from
a target, to project level `PropertyGroup`. It is set as:
`<_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm'))</_WasmIntermediateOutputPath>`
The `NormalizeDirectory` call converts this to a full path, presumably
using the current directory.
Because we are setting `$(_WasmIntermediateOutputPath)` at the project
level, it gets evaluated during the evaluation phase. And the current
directory doesn't seem to be set to the project directory at that point
in VS. So, `$(_WasmIntermediateOutputPath)` gets a wrong path like:
`C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm`.
And then when actually publishing, it fails to create this directory
with:
`Unable to create directory "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\". Access to the path 'C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\' is denied.`
Fix:
Set the property in `_InitializeCommonProperties` *target*, at which
point the current directory is correctly set.
Note:
- This doesn't seem to be reproducible outside VS
- It happens only on `publish`, because that's when the wasm targets
come into play.
--
1.
```
commit d574b03
Author: Ankit Jain <radical@gmail.com>
Date: Mon Jul 19 01:02:01 2021 -0400
[wasm] Add support for using custom native libraries (dotnet#55797)
```1 parent ec2d25c commit 83c0088
2 files changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
| |||
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| 108 | + | |
| 109 | + | |
109 | 110 | | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | | - | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | | - | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
0 commit comments