slicybtw
Explore posts from serversExit Error 139
im making an audio recorder using NAUDIO but everytime i run it exits with code 139
this my Program.cs
and this is my Program.csproj
using System.Diagnostics;
using System.Collections;
using System.Drawing;
using Microsoft.VisualBasic;
using System.Data;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System;
using NAudio.Wave;
class Program
{
static void Main()
{
Console.WriteLine("Enter To Stop");
var fileName = "recording.wav";
using (var waveIn = new WaveInEvent())
{
waveIn.WaveFormat = new WaveFormat(44100, 1);
using (var waveFileWriter = new WaveFileWriter(fileName, waveIn.WaveFormat))
{
waveIn.DataAvailable += (s, e) =>
{
waveFileWriter.Write(e.Buffer, 0, e.BytesRecorded);
};
waveIn.RecordingStopped += (s, e) =>
{
waveFileWriter.Dispose();
waveIn.Dispose();
};
waveIn.StartRecording();
Console.ReadLine();
waveIn.StopRecording();
}
}
Console.WriteLine($"Recording stopped And Audio saved to {fileName}");
}
}
using System.Diagnostics;
using System.Collections;
using System.Drawing;
using Microsoft.VisualBasic;
using System.Data;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System;
using NAudio.Wave;
class Program
{
static void Main()
{
Console.WriteLine("Enter To Stop");
var fileName = "recording.wav";
using (var waveIn = new WaveInEvent())
{
waveIn.WaveFormat = new WaveFormat(44100, 1);
using (var waveFileWriter = new WaveFileWriter(fileName, waveIn.WaveFormat))
{
waveIn.DataAvailable += (s, e) =>
{
waveFileWriter.Write(e.Buffer, 0, e.BytesRecorded);
};
waveIn.RecordingStopped += (s, e) =>
{
waveFileWriter.Dispose();
waveIn.Dispose();
};
waveIn.StartRecording();
Console.ReadLine();
waveIn.StopRecording();
}
}
Console.WriteLine($"Recording stopped And Audio saved to {fileName}");
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NAudio" Version="2.2.1" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NAudio" Version="2.2.1" />
</ItemGroup>
</Project>
2 replies
C# not recognizing packages
i keep getting this error whenever i run my code using restsharp
this my code
i installed both NuGet And RestSharp, is there a way to fix this?
mcs Program.cs
Program.cs(6,7): error CS0246: The type or namespace name `RestSharp' could not be found. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
mcs Program.cs
Program.cs(6,7): error CS0246: The type or namespace name `RestSharp' could not be found. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using RestSharp;
namespace Main
{
class Program
{
static void Main(string[] args) {
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using RestSharp;
namespace Main
{
class Program
{
static void Main(string[] args) {
}
}
}
37 replies