Click here to Skip to main content
15,890,415 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've just had a function written for me which uses MediaToolKit.DLL which has been added to the Bin folder. When I call the function, I get the error 'Access to the path '\MediaToolkit' is denied'. Does anyone know how to fix this? I am trying to call the function like this..

VB
ConvertFile("E:\kunden\homepages\19\d664110395\www\example\catalog\videos\" & imageFilename, "E:\kunden\homepages\19\d664110395\www\example\catalog\videos\new\" & imageFilename, Options.VideoSize.Hd720)


And here is the function..

VB
    Private Function ConvertFile(ByVal sourceFile As String, ByVal destinationFile As String,
                             ByVal videoSize As MediaToolkit.Options.VideoSize) As MediaFile

    Dim inputFile = New MediaFile With {.Filename = sourceFile}
    Dim outputFile = New MediaFile With {.Filename = destinationFile}

    Using engine = New Engine()
        'engine.ConvertProgressEvent = RaiseEvent engine_ConvertProgressEvent
        'engine.ConversionCompleteEvent = RaiseEvent engine_ConversionCompleteEvent
        engine.Convert(inputFile, outputFile, New MediaToolkit.Options.ConversionOptions With {
        .VideoSize = videoSize
    })
        engine.GetMetadata(inputFile)
        engine.GetMetadata(outputFile)
    End Using

    Dim inputMeta As Metadata = inputFile.Metadata
    Dim outputMeta As Metadata = outputFile.Metadata

    Return outputFile
End Function


What I have tried:

I have changed the path of the input and output files sent to the function but still the same issue.
Posted
Updated 3-Apr-20 20:02pm
Comments
MadMyche 3-Apr-20 19:37pm    
Did you just download this DLL? Perhaps should check the properties of this in your file-system to make sure it is not locked at that level
Member 13779417 3-Apr-20 20:39pm    
Many thanks for your suggestion. I had someone develop the function for me and add the dll file. I've just checked the properties of the dll file and it was set to READ and EXECUTE, I tried setting it to WRITE too but it made no difference. Is that what you meant? I'm just learning so not too clued up with it all.

1 solution

I'd suggest you go back to the person who wrote the function and ask them - at a guess the MediaToolKit DLL file needs to be installed with either other DLL files or data in a specific folder - \MediaToolKit - rather than just copied to a folder.

Depending on which one it is, you may be able to add it correctly via it's NuGet package - but you need to talk to the author of the function to find out exactly which file you needed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900