Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot assign non-numeric values to 'var' with syntax as in Tutorial.cs.docx #73

Open
burque505 opened this issue May 5, 2024 · 0 comments

Comments

@burque505
Copy link

ISSUE: Running tutorial.exe from SampleProjects folder results in errors.
To reproduce, change <% var i = 1; %> to <% var i = "one"; %> in Tutorial.cs.docx.
Reverting to int instead of string removes the errors.

Errors:
C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\Samples\SampleProjects\Tutorial\bin\Release\net6.0>tutorial.exe > ouch.txt Unhandled exception. SharpDocx.SharpDocxCompilationException: Exception of type 'SharpDocx.SharpDocxCompilationException' was thrown. at SharpDocx.DocumentCompiler.Compile(String sourceCode, List1 referencedAssemblies) in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\SharpDocx\DocumentCompiler.cs:line 376
at SharpDocx.DocumentCompiler.Compile(Stream viewStream, String className, String baseClassName, Type modelType, List1 usingDirectives, List1 referencedAssemblies) in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\SharpDocx\DocumentCompiler.cs:line 152
at SharpDocx.DocumentAssembly.Create(Stream viewStream, Type baseClass, Type modelType) in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\SharpDocx\DocumentAssembly.cs:line 101
at SharpDocx.DocumentAssembly..ctor(Stream viewStream, Type baseClass, Type modelType) in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\SharpDocx\DocumentAssembly.cs:line 19
at SharpDocx.DocumentFactory.CreateInternal(String viewId, Stream viewStream, Object model, Type baseClassType, Boolean forceCompile) in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\SharpDocx\DocumentFactory.cs:line 165
at SharpDocx.DocumentFactory.Create(String viewPath, Object model, Type baseClassType, Boolean forceCompile) in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\SharpDocx\DocumentFactory.cs:line 118
at Tutorial.Program.Main() in C:\Users\perplexed\Documents\repos\repos 2024\SharpDocx-master\Samples\SampleProjects\Tutorial\Program.cs:line 32`

Current version (2.5), Win10 Pro 64-bit, VS 17.9.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant