简体   繁体   中英

ASP.NET builds success but showing “Syntax Error” on web page

I have an ASP.NET project which is started by an other team, and I'm currently working on it.

My problem is, I'm specially doing syntax errors and trying to compile project. Project compiles without any errors. But error is there.

When I try to open the web page it shows me the error like :

在此处输入图片说明

How can I prevent build if there is an error?

Any .cs file located in ~/App_Code/ will be dynamically compiled when the application runs.

So in Visual Studio, we can build the same class twice by adding it to App_Code and setting the Build Action to Compile.

or you can avoid app_code folder

Change your code to

public string facilityOpeningHours{get;set;}

You must get the compile time error as the syntax is wrong for initialising the getter & setter for facilityOpeningHours property

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM