ASP.NET system.codedom无法正常工作

时间:2017-09-20 09:25:11

标签: c# asp.net codedom

我正在制作一个asp.net网站。

有没有办法可以放这个代码:

<system.codedom>
    <compilers>
        <compiler 
            language="c#;cs;csharp" 
            extension=".cs" 
            compilerOptions="/unsafe"
            type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </compilers>
</system.codedom>

当我尝试将其放入其中时会出错:

Validation (XHTML5): Element 'system.codedom' is not supported

1 个答案:

答案 0 :(得分:1)

也许这项工作

/**
 * Read file list from Google Drive.
 * @param service an authenticated <code>Drive</code> object needed to send the request
 * @return Answer the list of files.
 * @throws IOException
 */
protected List<File> readFiles( final Drive service ) throws IOException {
    final List<File> result = new ArrayList<File>();
    final Files.List request = service.files().list();
    do {
        final FileList files = request.execute();
        result.addAll(files.getItems());
        request.setPageToken(files.getNextPageToken());
    } while (request.getPageToken() != null && request.getPageToken().length() > 0);
    return result;
}