Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7521865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:21:12+00:00 2026-05-30T02:21:12+00:00

I am using the ID3lib and the MP3Lib of their examples ( http://id3lib.sourceforge.net/ )

  • 0

I am using the ID3lib and the MP3Lib of their examples ( http://id3lib.sourceforge.net/ )
When I edit my MP3s it works sometimes, and sometimes not. Then I get a exception, that the File cannot be rewritten. The files are not in use. I think, the problem is, that I set ID3v2 tags through the library and that the MP3s are maybe only with a ID3v1 header?
Does anyone had problems like that before?

EDIT:
I managed to find the problem, which happens whenever I try to save the picture for the album.

string filepath = Application.StartupPath + @"\temp.jpg";
if(File.Exists(filepath))
    File.Delete(filepath);

FileStream fs = File.Create(filepath);
id3AlbumImage.Image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);
fs.Close();

using (FileStream stream = File.Open(filepath, FileMode.Open, FileAccess.Read, FileShare.Read))
{
    byte[] buffer = new Byte[stream.Length];
    stream.Read(buffer, 0, buffer.Length);
    if (buffer != null)
    {
        MemoryStream memoryStream = new MemoryStream(buffer, false);
        _mp3File.TagHandler.Picture = Image.FromStream(memoryStream);
    }
}

The Error says:
System.IO.IOException: The file to be replaced could not be overwritten by the file to be moved. The file to be replaced has retained its original name.

   bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   bei System.IO.__Error.WinIOError()
   bei System.IO.File.Replace(String sourceFileName, String destinationFileName, String destinationBackupFileName, Boolean ignoreMetadataErrors)
   bei Com.Hertkorn.Helper.Filesystem.FileMover.FileMove(FileInfo sourceLocation, FileInfo targetLocation, FileInfo backupLocation) in E:\Projects\id3lib\Mp3Lib\Utils\FileMover.cs:Zeile 51.
   bei Mp3Lib.Mp3File.RewriteFile(FileInfo bakFileInfo) in E:\Projects\id3lib\Mp3Lib\MP3\Mp3File.cs:Zeile 346.
   bei Mp3Lib.Mp3File.Update() in E:\Projects\id3lib\Mp3Lib\MP3\Mp3File.cs:Zeile 231.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:21:13+00:00Added an answer on May 30, 2026 at 2:21 am

    The actual problem is NTFS. If you rewrite the ID3 Tags you open the MP3 itself. It seems like this opening process is occasionally throws an error. As said, it just happen “sometimes”.
    Right now, I really did the dirty solution and did a try catch around it, in case of that error, I just redo the same. Funny thing is, that this works so far.
    I will mark this answer as solution, even if its a dirty one. If anyone knows a better way, or a solution for it, let us know!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jQuery, how do I get the value from a textbox and then load
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using the HTML5 File API I can get the Binary String representation of a
using file_get_contents , I open an Internet URL and get the contents of this
Using Google Maps InfoBox - http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html Currently the map will scroll - pan control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.