question

Javaid-0299 avatar image
0 Votes"
Javaid-0299 asked ·

Visual Studio 2019 C# Source Not Available Error

Hi, I have visual studio 2019. This week I moved up a version to 16.8.6 from 16.4 as per Microsoft recommendation. I am using MVC framework. I return a view based on a condition as follows. if condition A return View "A" else condition B return View "B" else return View "C" Application runs successfully for showing views A. But for view B it says source not available. I have check my windows directory for my solution, and View B is there, name is correct, spelling is correct yet I just cannot seem to launch View B. I have also tried cleaning the solution and rebuild, removed debug setting 'require source file to exactly match oriinal version' but nothing seems to be working. Your help is appreciated.

dotnet-csharpvs-general
· 4
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Javaid-0299 , did everything work well before you updated Visual Studio 2019 from 16.4 to 16.8.6?

0 Votes 0 ·

Yes....It did. Each time visual studio is upgraded, errors start appearing in CHTML... Microsoft does not seem to give a specific error...just general errors.

For example, the CHTML for View that should go based on condition, works if you reduce the number of elements in the UI. If you keep the elements you need it causes Source Not Found Stackoverflow error.

Is there a size limit on a CHTML file for MVC?

0 Votes 0 ·

Hi @Javaid-0299 , thank you for your feedback. From the aspect of Visual Studio, I suggest you report this issue in Developer Community as this issue may be caused by the update of VS2019. For MVC related aspects, I may suggest you add MVC related tag to let more engineers(forum members) who are familiar with MVC development help you solve this issue better.


0 Votes 0 ·

the issue is actually in MVC based on our analysis. It seems that if you reduce the number of variables within chtml, it works... else it fails. It definitely is MVC related as you have to create partial views to get around this performance problem. It seems Microsoft needs to provide a fix on this to allow a view to have as many variables as needed or provide an official answer on how to manage it.

0 Votes 0 ·

1 Answer

DuaneArnold-0443 avatar image
0 Votes"
DuaneArnold-0443 answered ·

Are you taking about using the MVC UI design pattern for a Windows form solution?

Where is this decision making process happening as to what view to show?

· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes it is MVC UI design pattern. Decion making is happening in the action upon submit. I have made more progress...in that I can render the page now but am getting same memory overflow stack errors as with source not available.

The chtml UI for the view has 5 tabs. If I comment out one tab then it works. else it has memory errors.

0 Votes 0 ·

Maybe someone at the MVC forum in ASP.NET forums can help you.

https://forums.asp.net/


0 Votes 0 ·