Skip to content

Commit eb9f560

Browse files
authored
Update compiled-languages-csharp.md
1 parent eb91170 commit eb9f560

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

troubleshooting/codeql-builds/compiled-languages-csharp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ This can manifest through a variety of errors
155155
- `error ASPPARSE`
156156
- `[error]C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config(113,0): Error ASPCONFIG: Could not load type`
157157
- `Error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.`
158-
- `(AfterBuildCompiler target) -> D:\a\Orchard\Orchard\src\Orchard.Web\Modules\Orchard.Glimpse\web.config(38): error ASPCONFIG: Could not load file or assembly 'System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)`
159-
158+
- `(AfterBuildCompiler target) -> <path>web.config(##): error ASPCONFIG: Could not load file or assembly '...' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)`
159+
- `(MvcBuildViews target) -> <path>\web.config(##):error ASPCONFIG: Could not load file or assembly '...' or one of its dependencies. The system cannot find the file specified.`
160160
The CodeQL compiler tracer used for `csharp` will auto inject the `/p:MvcBuildViews=true` flag. This pre-compilation of Views gives us the ability to extract the generated code from those files, leading to (potentially) better error reporting and location information if a query does flag an issue. The lack of view information passing through CodeQL to the compiler will lead to an incomplete database, where important dataflow sources/sinks/taint-steps are not included in the analysis.
161161

162162
The recommendation here is to ensure that passing `/p:MvcBuildViews=true` to your CI build will compile even outside of CodeQL. Having a developer reivew this on their local machine is the best scenario. This can be on done on the specific web project by adding `<MvcBuildViews>true</MvcBuildViews>` to the local .csproj ( you will often find this defaulted to false). The MVC full framework steps are listed [here](https://learn.microsoft.com/en-us/archive/blogs/jimlamb/turn-on-compile-time-view-checking-for-asp-net-mvc-projects-in-tfs-build-2010). There are a few different reasons why this can cause your project to fail compilation.

0 commit comments

Comments
 (0)