Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Image Tag (helper) displaying on the HtmlGenerationWebSite #5694

Closed
ignatandrei opened this issue Jan 18, 2017 · 3 comments
Closed

Image Tag (helper) displaying on the HtmlGenerationWebSite #5694

ignatandrei opened this issue Jan 18, 2017 · 3 comments
Assignees

Comments

@ignatandrei
Copy link
Contributor

ignatandrei commented Jan 18, 2017

The Image Tag (helper) is not displaying the images
Steps to reproduce:
1, Open the MVC.sln solution from branch rel/1.1.1
2. Go to HtmlGenerationWebSite project, set as startup
3. Run the project - it will go to http://locahost:<port> . Modify to http://locahost:<port>/HtmlGeneration_Home/image
4. Assert all images are not seeing ( red block, red versioning)
e.g. this image will not display

<img src="~/images/red.png" alt="Red block" title="&lt;the title>">

Solution( and I will make a fork and pull request ASAP)

  1. Add "
    Microsoft.AspNetCore.StaticFiles": "1.1.0"
    to project,json
  2. Add
    app.UseStaticFiles();
    in the
    public void Configure(IApplicationBuilder app)
    from Startup class.
@Eilon
Copy link
Member

Eilon commented Jan 19, 2017

@dougbu any thoughts on this? Is this supposed to work? (Presumably, yes...)

@Eilon Eilon added this to the 2.0.0 milestone Jan 19, 2017
@dougbu
Copy link
Member

dougbu commented Jan 19, 2017

We don't worry too much about the end-to-end behaviour of the functional test sites. The most important thing here is that src="~/images/red.png" in the .cshtml results in src="/images/red.png" in the generated HTML.

That said, adding StaticFiles to the project has no downside.

dougbu pushed a commit that referenced this issue Jan 26, 2017
* Add "
`Microsoft.AspNetCore.StaticFiles": "1.2.0-*"`
to project,json
Add
`app.UseStaticFiles();`
in the
`public void Configure(IApplicationBuilder app)`
from `Startup` class.

Addresses #5694
@dougbu
Copy link
Member

dougbu commented Jan 26, 2017

@dougbu dougbu closed this as completed Jan 26, 2017
@dougbu dougbu added 3 - Done and removed 1 - Ready labels Jan 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants