Comments (5)
This is because the template text has \n
rather than the \r\n
for end of lines where FixupTemplate
is coded to expect the latter. While it'd be nice if this was fixed, or even raised an error with a message that indicated this was the problem, anyone else who is searching for the exception in this error will hopefully read this and can add some code like the following to work around it:
string templateText = File.ReadAllText(templateFilePath);
if (!templateText.Contains("\r\n"))
{
templateText = templateText.Replace("\n", "\r\n");
}
from westwind.razorhosting.
You'll need to provide more info. Most likely you have an expression error in the script your running.
from westwind.razorhosting.
@rmtew Is correct. Just ran into this. Happened when it worked locally, got sent to source control, but the line endings were modified.
Would be great to set line endings in the config.
from westwind.razorhosting.
Hmmm, I thought I fixed that in the last round of updates. Slightly different code though. The above is too volatile - that can break in all sorts of ways.
from westwind.razorhosting.
Ok, well I thought I'd help. I will close the PR.
from westwind.razorhosting.
Related Issues (20)
- RenderTemplate returns null when there are media queries in template HOT 1
- Azure Function with this project returns null HOT 1
- temp files HOT 1
- Razor Template Editor for Windows Application HOT 1
- Class AppTemplates in landing page doesn't compile HOT 1
- Support for newer C# language features, e.g. string interpolation HOT 15
- Generated source files should use fully qualified names for Westwind classes to avoid compile errors HOT 8
- Using RazorHosting with in an AzureFunction HOT 1
- reference needed for Html helpers? HOT 1
- Remoting error due to GC issues when using App Domain HOT 5
- Rendering view with a layout and a partial view results in the layout not being rendered HOT 10
- IndexOutOfRangeException throw from GetAssemblyFromStringAndCache() HOT 2
- Add Css File HOT 4
- Westwind.RazorHosting assembly should be strong named HOT 1
- Calling RenderPartial inside of a Razor helper results in the contents of the partial view being html encoded HOT 1
- Usage with ASP WebApi
- Thread safety of RazorEngine.ErrorMessage
- Behaviour change between Source Code and Nuget Package
- Getting System.PlatformNotSupportedException and Unable to use on .net core Console application HOT 2
- RenderPage nor RenderPartial works
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 westwind.razorhosting.