Can you have Multi Line Strings without Roslyn?

171 Views Asked by At

I Currently have created an ASP.NET Empty website on VB.NET with nothing but a few pages and a WebConfig file. On one page I have an SQL String on multiple lines and I am getting the Error:

BC30648: String constants must end with a double quote.

I know if I install the Roslyn folder it will solve this problem:

install-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
install-package Microsoft.Net.Compilers

However, if I install this it will not work on my current hosting on 1&1 IONOS or localhost IIS; I believe this is because the server thinks it is a web Application and I am looking a website.

Is there a way to have Multi-line strings without the Microsoft.CodeDom.Providers.DotNetCompilerPlatform ?

1

There are 1 best solutions below

0
On

If the code module is NOT in the app_code folder? Then you can use free form text in your code. However, if you place the code module (or class) in the app_code folder, then that code is actually compiled at web load/runtime. You thus find:

You can compile in Visual Studio. But even with the local VS web server, you see/find that the code then gets compiled by the web server, and it will fail.

So, you can use free form text in your general approach to code (code behind). However, you can't use/place such code in the app_code folder.

You CAN use such code in "code behind" and in general code modules/class modules you add to the project. However, if any of the code modules are placed in the app_code folder, they do fail.

However, to answer the question? The above works with the new editor, but without as such, then both standard code modules and the App_Code don't allow free form text in the editor.