Skip to content

Fix image path resolution in Agent08 using IWebHostEnvironment#5

Merged
pournasserian merged 1 commit into
ui-enhancementfrom
copilot/sub-pr-1
Mar 12, 2026
Merged

Fix image path resolution in Agent08 using IWebHostEnvironment#5
pournasserian merged 1 commit into
ui-enhancementfrom
copilot/sub-pr-1

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

File.ReadAllBytesAsync("wwwroot/image.jpg") broke when the app was hosted with a different content root since it relied on the current working directory.

Changes

  • Agent08.razor: Inject IWebHostEnvironment and resolve the image path via WebRootPath
@inject IWebHostEnvironment WebHostEnvironment
...
var imageData = await File.ReadAllBytesAsync(Path.Combine(WebHostEnvironment.WebRootPath, "image.jpg"));

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] [WIP] Address feedback on CSS variables and redesign of agent pages Fix image path resolution in Agent08 using IWebHostEnvironment Mar 12, 2026
@pournasserian pournasserian requested a review from Copilot March 12, 2026 00:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@pournasserian pournasserian marked this pull request as ready for review March 12, 2026 00:44
@pournasserian pournasserian merged commit c18522a into ui-enhancement Mar 12, 2026
1 check passed
@pournasserian pournasserian deleted the copilot/sub-pr-1 branch March 12, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants