12 references to CreateFromFile
Microsoft.CodeAnalysis (3)
MetadataReference\AssemblyMetadata.cs (2)
164
return CreateFromFile(ModuleMetadata.
CreateFromFile
(path), path);
169
return new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.
CreateFromFile
(Path.Combine(Path.GetDirectoryName(path) ?? "", moduleName)));
MetadataReference\MetadataReference.cs (1)
228
/// It is recommended to use <see cref="AssemblyMetadata.CreateFromFile(string)"/> or <see cref="ModuleMetadata.
CreateFromFile
(string)"/>
Microsoft.CodeAnalysis.Scripting (1)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
255
newMetadata = ModuleMetadata.
CreateFromFile
(fullPath);
Microsoft.CodeAnalysis.UnitTests (8)
MetadataReferences\ModuleMetadataTests.cs (8)
117
Assert.Throws<ArgumentNullException>(() => ModuleMetadata.
CreateFromFile
((string)null));
118
Assert.Throws<ArgumentException>(() => ModuleMetadata.
CreateFromFile
(""));
119
Assert.Throws<ArgumentException>(() => ModuleMetadata.
CreateFromFile
(@"c:\*"));
122
Assert.Throws<IOException>(() => ModuleMetadata.
CreateFromFile
(@"http://goo.bar"));
123
Assert.Throws<FileNotFoundException>(() => ModuleMetadata.
CreateFromFile
(systemDrive + @":\file_that_does_not_exists.dll"));
124
Assert.Throws<FileNotFoundException>(() => ModuleMetadata.
CreateFromFile
(systemDrive + @":\directory_that_does_not_exists\file_that_does_not_exists.dll"));
125
Assert.Throws<PathTooLongException>(() => ModuleMetadata.
CreateFromFile
(systemDrive + @":\" + new string('x', 1000)));
126
Assert.Throws<IOException>(() => ModuleMetadata.
CreateFromFile
(Environment.GetFolderPath(Environment.SpecialFolder.Windows)));