Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Created Unassigned: Why first request still very slow?? [142]

$
0
0
I'm look at the article: http://stacktoheap.com/blog/2013/01/19/precompiling-razor-views-in-asp-dot-net-mvc-3/

and add the new version Razor generator Extends on visual studio 2012, I'm also add Nuget packege:RazorGenerator.mvc and RazorGenerator.MsBuild to my mvc4 project.

I find there is auto add a class, and it can auto execute when application start debug.

```
public static class RazorGeneratorMvcStart {
public static void Start() {
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) {
UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal
};

ViewEngines.Engines.Insert(0, engine);

// StartPage lookups are done by WebPages.
VirtualPathFactoryManager.RegisterVirtualPathFactory(engine);
}
```


But I'm not changed anything, the new version Something different with the article . like RazorGenerator.targets , So I don't changed anything.

and I also not add the RazorGenerator content to custom tools of .csthml file property, because the artile not like me use it . But when I debug , every thing fine , there is .cs file auto generate on obj/ folder all from Razor view.

I also add this on my .csproj file like the article said:

```
Target Name="BeforeBuild">
<ItemGroup>
<Content Remove="Views\**\*.cshtml" />
<None Include="Views\**\*.cshtml" />
</ItemGroup>
</Target>
```



and I publish my project use visual studio vs2012(remove recompile option on the publish)

and use IIS open . but ....the first request still very slow.......

Am I miss or the new version some changed? the view can normal open, but why the first request still slow?

specially when first request(not access view still very slow).

Why can't let the all class loading when the IIS start the website??

thanks , and sorry for my bad english.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>