✅ Adding Dependencies for a Script

I need to be able to run the example scripts given in the readme of the following library: https://github.com/Finzenku/Ps2IsoTools. I have been able to install .net on Linux, and have successfully installed the library into a project. However, I can't figure out how to properly import the library to allow for the example scripts to be run.
14 Replies
Angius
Angius17mo ago
If you're using a competent IDE, you can just write the code and use quick fixes to import the appropriate namespace If not, you'll have to import it manually with a using at the top of the file
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Gandhi Gaming 1869
Gandhi Gaming 1869OP17mo ago
Yeah, I'm just trying to run the example code they provided there. I'm not, at least yet, trying to at least write any significant code Right now the code I'm trying to run is the following
using Ps2IsoTools;

class TestClass{
static void Main(string[] args){
using (var reader = new UdfReader("/home/Downloads/Wallace & Gromit - The Curse of the Were-Rabbit (USA).iso")){

// Get list of all files
List<string> fullNames = reader.GetAllFileFullNames();

// FileIdentifiers are used to reference files on the ISO
FileIdentifier? fileId = reader.GetFileByName("file-name");

if (fileId is not null)
{
// // Read data from file
// using (BinaryReader br = new(reader.GetFileStream(fileId)))
// {
// Console.WriteLine(br.ReadString());
// }

// // Copy file from the ISO to your local drive
// reader.CopyFile(fileId, "path-to-copy-to");
System.Console.WriteLine(fileId.ToString());
}
}
}
}
using Ps2IsoTools;

class TestClass{
static void Main(string[] args){
using (var reader = new UdfReader("/home/Downloads/Wallace & Gromit - The Curse of the Were-Rabbit (USA).iso")){

// Get list of all files
List<string> fullNames = reader.GetAllFileFullNames();

// FileIdentifiers are used to reference files on the ISO
FileIdentifier? fileId = reader.GetFileByName("file-name");

if (fileId is not null)
{
// // Read data from file
// using (BinaryReader br = new(reader.GetFileStream(fileId)))
// {
// Console.WriteLine(br.ReadString());
// }

// // Copy file from the ISO to your local drive
// reader.CopyFile(fileId, "path-to-copy-to");
System.Console.WriteLine(fileId.ToString());
}
}
}
}
and I'm getting the errors /home/henry/ps2_editing/Program.cs(5,26): error CS0246: The type or namespace name 'UdfReader' could not be found (are you missing a using directive or an assembly reference?) [/home/henry/ps2_editing/ps2_editing.csproj] /home/henry/ps2_editing/Program.cs(11,2): error CS0246: The type or namespace name 'FileIdentifier' could not be found (are you missing a using directive or an assembly reference?) [/home/henry/ps2_editing/ps2_editing.csproj]
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Gandhi Gaming 1869
Gandhi Gaming 1869OP17mo ago
yeah it is within a csproj
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Gandhi Gaming 1869
Gandhi Gaming 1869OP17mo ago
here's the .csproj file for the project: `<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="Ps2IsoTools" Version="1.0.1" /> </ItemGroup> </Project>
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius17mo ago
It's there my dude
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Gandhi Gaming 1869
Gandhi Gaming 1869OP17mo ago
Is there a way to figure out what those statments should be without a configured IDE?
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Gandhi Gaming 1869
Gandhi Gaming 1869OP17mo ago
Yeah, that makes sense, I'll configure the IDE and add the necessary use staements.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server