Sitefinity / feather

mvc
Other
97 stars 68 forks source link

Razor views don't recompile after file is changed if Nuget Feather Razor precompilation is on. #2473

Open elivnjak opened 8 years ago

elivnjak commented 8 years ago

I have noticed an issue when converting my references to use Nuget Packages. When I make changes to the views they do not show up in the browser.

Test Steps:

After some investigation I found if I disabled the Feather Razor Precompilation the changes would appear without building the solution.

I did this by:

ie.

`<!-- Please uncomment this in case of using Feather Razor precompilation <RazorCodeGen ProjectRoot="$(MsBuildProjectDirectory)\$(FeatherResourcePackagesFolderName)\%(FeatherRazorSrcFiles.PackageName)\" FilesToPrecompile="@(FeatherRazorSrcFiles)" CodeGenDirectory="$(RazorViewsCodeGenDirectory)$(FeatherResourcePackagesFolderName)\%(FeatherRazorSrcFiles.PackageName)" RootNamespace="$(RootNamespace).$(FeatherResourcePackagesFolderName).%(FeatherRazorSrcFiles.PackageName)">

</RazorCodeGen> -->`

I then build the solution. The changes show up without me having to build the solution.

Any idea why this is? Am i doing something wrong?

Thanks, Edin

M-Yankov commented 7 years ago

I had similar issue with MVC layout templates. Modify the .cshtml file and the changes are not updated in the UI. The suggestion from @elivnjak didn't solve my problem. But I found another work-around: The solution was to edit the .csproj file of SitefinityWebApp and remove or comment out the following lines (at the end of the file):

 <Import Project="..\packages\RazorGenerator.MsBuild.2.4.1\build\RazorGenerator.MsBuild.targets" Condition="Exists('..\packages\RazorGenerator.MsBuild.2.4.1\build\RazorGenerator.MsBuild.targets')" />
 <Import Project="..\packages\Telerik.Sitefinity.Feather.1.5.470.0\build\Telerik.Sitefinity.Feather.targets" Condition="Exists('..\packages\Telerik.Sitefinity.Feather.1.5.470.0\build\Telerik.Sitefinity.Feather.targets')" />