Comments (8)
I was finally able to get everything working again on Ubuntu. To summarize, I took the following steps:
-
I generated a "refs" folder containing all of the required assemblies by adding
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
to the WebApp project. I copied the refs folder to the root web folder on Linux. I then removed the MvcRazorCompileOnPublish tag from my WebApp project. -
I removed the _ViewImports.cshtml file from Blogifier.Core/Views. I manually added
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
to all of the views to compensate. -
I updated EmbeddedResources.cs as described by the post directly above.
I realize these aren't ideal changes, but that's was was necessary for me to get the core 2.0 package working on ubuntu. Hopefully you guys can find better workarounds.
from blogifier.
Thanks for doing this, we soon will be ready for testing Linux/PostgreSql functionality and this might help to avoid some major headaches.
from blogifier.
I think i found a workaround for the problem.
Adding the following into the WebApp project file:
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
will create a 'refs' folder with all the required assemblies. If I FTP the 'refs' folder to my server, the pages work again. The downside is that the initial load after a dotnet restart will cause the loading to be very slow, although that only affects the initial page load. Subsequent page loads are pretty quick.
I only needed to copy the 'refs' folder, and not the 'Views' folder. After the 'refs' folder is copied, you can delete the code above from the webapp project and publish as before, so long as you leave the 'refs' folder on your server in your web directory.
from blogifier.
Just a quick update on this. This might be related to the switch to Core 2.0 (I've been using the dev branch). I noticed other problems, such as the _ViewImports.cshtml file not really working. I've had to update all @model
references in the /View/Account/ and /View/Manage/ folder to use fully qualified names, for example:
@model WebApp.Models.AccountViewModels.LoginViewModel
@inject Microsoft.AspNetCore.Identity.SignInManager<WebApp.Models.ApplicationUser> SignInManager
from blogifier.
I made some more progress on this. The reason why the _ViewImports wasn't working seems to be because it was conflicting with the _ViewImports from the Blogifier.Core project. Its possible that, since they were both in an identical location, they were conflicting with each other. Removing the _ViewImports.cshtml from Blogifier.Core made my WebApp work correctly.
I'm starting to understand how you guys got the Views from Blogifier.Core to work in the WebApp (and the purpose of the "PrependFileProvider" setting). Unfortunately, this doesn't seem to work anymore for me in the latest core 2.0 build on Ubuntu. I'll try to figure out why....
EDIT: By the way, the reason for the conflict of _ViewImports was because I had "PrependFileProvider" set to true. It seems that this caused the EmbeddedFileProvider to execute first, and hence the _ViewImports from Blogifier.Core was probably being used instead of the _ViewImports from my WebApp. I'm not certain that this was happening, but it does seem to explain why the Views from my WebApp weren't working unless I provided the full paths in the Views.
from blogifier.
In attempting to get the Views from Blogifier.Core working, I found another problem, which may again be related to the core 2.0 push.
In EmbeddedResources.cs, the following
if(ex.Message == "Write to non-body 304 response.")
needed to be changed to
if(ex.Message == "Write to non-body 304 response." || ex.Message == "Writing to the response body is invalid for responses with status code 304.")
The error message appears to be different than what was expected.
from blogifier.
I also encountered this problem:
it is broken out after release to Linux,but it is Passed on windows,I think the reason is that Windows and Linux have different paths, do you think?
Exception:
[Error] The view '"/Views/Blogifier/Themes/Standard/Index.cshtml"' was not found. Searched locations: ["/Views/Blogifier/Themes/Standard/Index.cshtml"]
from blogifier.
The current build is tested and working out of the box on Ubuntu, so closing this up.
from blogifier.
Related Issues (20)
- How do I start it? HOT 4
- Windows Error Log IIS Event ID 1020 - AspNetCore Module V2 - framework not found HOT 1
- Questions: How the data validation works for Blogifier HOT 1
- Open sourcing the official website? HOT 1
- PNG picture can not displayed in Post
- Localizer does not give correct results
- What tools were used to compile static files in Blogifier? HOT 2
- Custom cover images not showing in pages. HOT 2
- I made a step by step installation using Ubuntu
- Please add comments section HOT 9
- Stored XSS via filename parameter in '/api/storage/upload/PostImage' HOT 1
- Stored XSS on upload files. HOT 1
- Translate Tool HOT 1
- I can"Resource.zh-CN.resx"
- there is something with "Resource.zh-CN.resx" that I can't understand? HOT 2
- 该项目是否仍在维护? HOT 3
- Changing DB to SQL Server in VS does not work as described in 02-Database.md HOT 2
- Newsletter feature
- I think it's time to upgrade to .NET 7 :) HOT 2
- error: Sorry I did something wrong with the main branch HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blogifier.