Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
[browser] Make WASM framework asset CopyToOutputDirectory configurable#127285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
445d3341037300fc681c1b21ad5441b60c39e1c91ac5040e2f2395716815cdbf83046307d1d499e284fd00635acc6fe5e5906e58407f446a8eb1a8040bdbabFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -60,8 +60,35 @@ public async Task BuildThenPublishWithAOT(Configuration config, bool aot) | ||
| (_, string output) = BuildProject(info, config, new BuildOptions(Label: "first_build", AOT: aot), isNativeBuild: aot); | ||
| BuildPaths paths = GetBuildPaths(config, forPublish: isPublish); | ||
| // With CopyToOutputDirectory=Never, framework files aren't copied to bin/_framework/ | ||
| // during build. They live in obj subdirs: dotnet.native.* in obj/wasm/for-build/ | ||
| // (for native rebuilds like Release+AOT), and JS/source maps in obj/{config}/{tfm}/fx/{source-id}/_framework/. | ||
| // The boot config (dotnet.js) is at obj/{config}/{tfm}/dotnet.js. | ||
| string fxFrameworkDir = WasmSdkBasedProjectProvider.GetMaterializedFrameworkDir(paths.ObjDir); | ||
| BuildPaths buildObjPaths = paths with { BinFrameworkDir = fxFrameworkDir }; | ||
| IDictionary<string, (string fullPath, bool unchanged)> pathsDict = | ||
| GetFilesTable(info.ProjectName, aot, paths, unchanged: false); | ||
| GetFilesTable(info.ProjectName, aot, buildObjPaths, unchanged: false, bootConfigDir: paths.ObjDir); | ||
| // dotnet.native.* are produced by the native rebuild into obj/wasm/for-build/ using | ||
Comment on lines
+69
to
+73
CopilotAI | ||
| // their canonical (non-fingerprinted) names — fingerprinting is applied later when | ||
| // publishing to bin. | ||
| foreach (var nativeName in new[] { "dotnet.native.wasm", "dotnet.native.js" }) | ||
| { | ||
| if (pathsDict.TryGetValue(nativeName, out var entry)) | ||
| { | ||
| pathsDict[nativeName] = (Path.Combine(paths.ObjWasmDir, nativeName), entry.unchanged); | ||
| } | ||
| } | ||
| // dotnet.runtime.js lives in the materialized fx dir under its canonical (non-fingerprinted) | ||
| // name during build — fingerprinting is applied later when publishing to bin. GetFilesTable | ||
| // rewrites this entry to the fingerprinted name (from the boot config, which already reflects | ||
| // the publish layout), so override it back to the unfingerprinted obj/fx path. | ||
| if (pathsDict.TryGetValue("dotnet.runtime.js", out var runtimeJsEntry)) | ||
| { | ||
| pathsDict["dotnet.runtime.js"] = (Path.Combine(fxFrameworkDir, "dotnet.runtime.js"), runtimeJsEntry.unchanged); | ||
| } | ||
| string mainDll = $"{info.ProjectName}.dll"; | ||
| var firstBuildStat = StatFiles(pathsDict); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
CopilotAIApr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overrides
_WasmFrameworkCopyToOutputDirectoryunconditionally. To keep the file overrideable (and consistent with the surrounding properties in thisPropertyGroup), consider setting it only when it’s not already set (e.g., add a Condition checking for empty).