Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

Until Beta 4 is released, here is how to fix the problem where Paint.NET crashes when trying to save a TGA image. (solution originally posted here: http://paintdotnet.12.forumer.com/viewtopic.php?t=375)

Simply go to the command line (Start -> Run, type "cmd" and click OK) and type the following:

%WINDIR%\Microsoft.Net\Framework\v1.1.4322\gacutil.exe /u TgaFileType

You should see output similar to the following:

Microsoft (R) .NET Global Assembly Cache Utility.  Version 1.1.4318.0 
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. 


Assembly: TgaFileType, Version=2.5.2108.39008, Culture=neutral, PublicKeyToken=85cad16301864386, Cus 
tom=null 
Uninstalled: TgaFileType, Version=2.5.2108.39008, Culture=neutral, PublicKeyToken=85cad16301864386, 
Custom=null 

Number of items uninstalled = 1 
Number of failures = 0

I have a "real" fix for this, but it won't be available until Beta 4 is released. Thanks for your patience everyone!

Very verbose explanation of the bug (for those who are curious):

Interestingly, the code for saving/loading a TGA image hasn't even changed in Beta 3 and is not the culprit for this crash. We have started to strong-name* our assemblies with this latest release and there seems to have been a version mismatch in the way that the file format configuration settings were being saved and loaded.

Because of the move to strong-naming, we had to update our code that locates the assembly that can handle loading the file type settings. Unfortunately, we didn't realize this until after Beta 3 was published. Basically we weren't providing enough information for .NET to be able to locate and load the assembly correctly, and the fix above removes the TGA code from the GAC and lets .NET load things using "the old way."

* "Strong-naming" is a way to give an assembly (DLL) something of a more fully qualified name, or identity. Normally you might write code saying, "load the assembly called DataStorage.dll" and the system will look in the current directory, and then in the system directory, for the file.

With strong naming you specify the name, the version, and a public-key token (it's like a signature). Now you say "load the assembly called DataStorage, Version=1.2.3.4, PublicKey token=1234abcd5678efab". This forms a strong identity for the assembly. For example, if I release version 1.2.3.5 of DataStorage, then all the old code that still wants to use 1.2.3.4 is still able to do so. This is very important on servers so that applications that are deployed and working great don't get their dependencies updated with new features (and new bugs) that change the way things work.

Also, if someone else publishes an assembly called "DataStorage", their PublicKey token will be different, and thus the correct assembly will still be loaded.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...