Miscellaneous problems and solutions, miscellaneous Solutions
Just as I started my blog, I had no idea how to get started. I had to pile up one article and take it as a note.
Although you have registered a blog garden account for a long time, most of them just go around or look for answers when you encounter problems during development.
As a small but rare female programmer in the circle, engaged in Web development, has always been engaged in MVC. To be honest, I am not interested in coding, But I was transferred to the software engineering major that year, and everything went on this road with its nature, all for mixed meals.
After several years of hard work, I slowly felt that I was almost incapable of learning. Look at the status quo of the times, look at yourself, observe the surroundings ...... Should I change something? I have been graduating for several years, but I do not know how to start. I am still a confused lamb.
Thank you for your advice!
1. ViewBag prompts that one or more types required for compiling dynamic expressions cannot be found
For web MVC projects, in the Razor view, you can often see that the place where ViewBag is used on the page prompts "one or more types required for compiling dynamic expressions cannot be found. Is the reference missing ?", However, project compilation and running are not affected.
The solutions found on the Internet are unknown, so they are all listed. You can try them all:
1. Check whether Microsoft. Csharp is referenced, and set the copy local attribute to true.
Local replication solves the problem of missing references from copying the entire solution to other machines.
2. Clear all folders under C: \ windows \ Microsoft. NET \ Framework \ v4.0.30319 \ Temporary ASP. NET Files \ root.
Delete Temporary Files in the directory C: \ Users \ {your computer name} \ AppData \ Local \ Temp \ Temporary ASP. NET Files.
I tried the above and it was useless. Fortunately, there was no impact, but it was quite uncomfortable to look at the red wavy lines. Let's put it for the moment. If it doesn't happen, it will happen someday.
2. Unable to wait in catch clause
Solution:
In fact, this problem has been solved in C #6.0:
However, I think some people use VS 2013 like me. At this time, we can use the nuget package Microsoft. codeDom. providers. dotNetCompilerPlatform: after installing the Roslyn compiler. configure <system. codedom> <compilers> to replace the default compiler. After the bin folder is re-generated, A roslyn folder will be generated at the same time. Do not forget to include the folder during release.
<system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" /> </compilers> </system.codedom>