Skip to content

Commit a243b76

Browse files
committed
Add docs for IL3001
1 parent 8e5b010 commit a243b76

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

docs/code-quality/code-analysis-warnings-for-managed-code-by-checkid.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ f1_keywords:
288288
- CA5122
289289
- CA5374
290290
- IL3000
291+
- IL3001
291292
ms.assetid: 5cb221f6-dc59-4abf-9bfa-adbd6f907f96
292293
author: mikejo5000
293294
ms.author: mikejo
@@ -600,4 +601,5 @@ The following table lists Code Analysis warnings for managed code by the CheckId
600601
| CA5400 | [CA5400 Ensure HttpClient certificate revocation list check is not disabled](../code-quality/ca5400.md) | A revoked certificate isn't trusted anymore. It could be used by attackers passing some malicious data or stealing sensitive data in HTTPS communication. |
601602
| CA5401 | [CA5401 Do not use CreateEncryptor with non-default IV](../code-quality/ca5401.md) | Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks. |
602603
| CA5402 | [CA5402 Use CreateEncryptor with the default IV](../code-quality/ca5402.md) | Symmetric encryption should always use a non-repeatable initialization vector to prevent dictionary attacks. |
603-
| IL3000 | [IL3000 Avoid using accessing Assembly file path when publishing as a single-file](../code-quality/il3000.md) | Avoid using accessing Assembly file path when publishing as a single-file |
604+
| IL3000 | [IL3000 Avoid accessing Assembly file path when publishing as a single-file](../code-quality/il3000.md) | Avoid using accessing Assembly file path when publishing as a single-file |
605+
| IL3001 | [IL3000 Avoid accessing Assembly file path when publishing as a single-file](../code-quality/il3000.md) | Avoid accessing Assembly file path when publishing as a single-file |

docs/code-quality/il3000.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "IL3000: Avoid using accessing Assembly file path when publishing as a single-file"
2+
title: "IL3000: Avoid accessing Assembly file path when publishing as a single-file"
33
description: "Assembly.Location always returns an empty string for assemblies embedded in a single-file bundle"
44
ms.date: 08/04/2020
55
ms.topic: reference
@@ -12,7 +12,7 @@ f1_keywords:
1212
- "IL3000"
1313
- "AvoidAssemblyLocationInSingleFile"
1414
---
15-
# IL3000: Avoid using accessing Assembly file path when publishing as a single-file
15+
# IL3000: Avoid accessing Assembly file path when publishing as a single-file
1616

1717
## Cause
1818

docs/code-quality/il3001.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: "IL3001: Avoid accessing Assembly file path when publishing as a single-file"
3+
description: "Assembly.GetFile(s) will throw for assemblies embedded in a single-file app"
4+
ms.date: 08/18/2020
5+
ms.topic: reference
6+
author: agocke
7+
ms.author: angocke
8+
manager: angocke
9+
ms.workload:
10+
- "multiple"
11+
f1_keywords:
12+
- "IL3001"
13+
- "AvoidAssemblyLocationInSingleFile"
14+
---
15+
# IL3001: Avoid accessing Assembly file path when publishing as a single-file
16+
17+
## Cause
18+
19+
When publishing as a single-file (for example, by setting the PublishSingleFile property in a project to true), calling the `Assembly.GetFile(s)` methods for
20+
assemblies embedded inside the single-file bundle always throws an exception.
21+
22+
## How to fix violations
23+
24+
To embed files in assemblies in single-file bundles, consider using embedded resources and the `Assembly.GetManifestResourceStream` method.
25+
26+
## When to suppress warnings
27+
28+
It's appropriate to silence this warning if the assembly being accessed is definitely not in the single-file bundle. This may be the case if the assembly is being loaded dynamically from a file path.

docs/code-quality/toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,5 +989,7 @@
989989
items:
990990
- name: Overview
991991
displayName: "publish warnings"
992-
- name: "IL3000: Avoid using accessing Assembly file path when publishing as a single-file"
992+
- name: "IL3000: Avoid accessing Assembly file path when publishing as a single-file"
993993
href: il3000.md
994+
- name: "IL3001: Avoid accessing Assembly file path when publishing as a single-file"
995+
href: il3001.md

0 commit comments

Comments
 (0)