Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

c# - Why is my deployed application still reading the cshtml view instead of the precompiled view

I am precompiling my razor views in my VS publish profile by setting the following properties:

  1. Precompile options: deselect "Allow precompile site to be updatable", deselect "Emit debug information"
  2. Merge options: select "Merge all outputs to a single assembly", give name "AppCode", check "Treat as library component (remove the AppCode.compiled file).

In order to test whether my application was actually reading from the compiled views, I renamed one of my cshtml files, and tested locally. All good, the view still loaded fine indicating that the compiled view was being called.

However, when I deployed all the binaries to the server and did the same test by renaming a cshtml file, the browser responsed with server 500 error.

What am I missing please?

question from:https://stackoverflow.com/questions/66045888/why-is-my-deployed-application-still-reading-the-cshtml-view-instead-of-the-prec

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

So the issue turned out to be the missing PrecompiledApp.config file that was not uploaded to the server. After uploading the file, all good.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...