Reputation: 228
I started working on a project which currently contains a mix of aspx-files and cshtml-files. One of my tasks is to convert aspx to cshtml.
Problem is, that after renaming the file (e.g. Home.aspx to Home.cshtml) the actionmethod "Home" can´t find the file.
So I think there must be a link between actionmethod and file, which is not updated after renaming the file - could that be correct? If so, where can I find it and what can I do to make this work?
Thanks!
Upvotes: 1
Views: 3523
Reputation: 1009
Not sure at what point you are encountering this issue, but I had a similar issue when I converted files from aspx to cshtml. In my case everything built fine, but on publishing the files did not deploy. It turned out that in the csproj file, the entries for these pages were were tagged 'None' instead of 'Content' like so:
<None Include="Home.cshtml" />
Instead of
<Content Include="Home.cshtml" />
When an entry is tagged None, it is not included in a publish. I manually changed the entries to "Content" in the csproj, republsihed and everything was fine.
See this answer for more information on build action properties.
Upvotes: 1