Giter VIP home page Giter VIP logo

Comments (13)

jacobbo avatar jacobbo commented on July 24, 2024

from webeye.

fastlink30 avatar fastlink30 commented on July 24, 2024

WebEye.Controls.WinForms.WebCameraControl v1.0.2 from nuget
from references on project:
Runtime version v2.0.50727
Win10

from webeye.

wilsoneden avatar wilsoneden commented on July 24, 2024

I am also experiencing the same problem.

System.UnauthorizedAccessException: Access to the path 'C:\Users\DEV\AppData\Local\Temp\tmp707E.tmp' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at System.IO.File.Delete(String path)
at WebEye.Controls.WinForms.StreamPlayerControl.StreamPlayerProxy.Dispose() in D:\dev\GitHub\WebEye\StreamPlayerControl\WinForms\StreamPlayerControl\StreamPlayerControl\StreamPlayerProxy.cs:line 164
at WebEye.Controls.WinForms.StreamPlayerControl.StreamPlayerControl.Dispose(Boolean disposing) in D:\dev\GitHub\WebEye\StreamPlayerControl\WinForms\StreamPlayerControl\StreamPlayerControl\StreamPlayerControl.cs:line 139
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)

It happens when the parent form of the control is disposed. I suppose it is trying to delete the temporary files. But then when the parent form is implemented with Using theForm ... End Using, it would then delete everything when the form disposes.

Please advice.
Thank you.

from webeye.

jacobbo avatar jacobbo commented on July 24, 2024

that file
C:\Users\DEV\AppData\Local\Temp\tmp707E.tmp
could you please check its attributes? Is it readonly?

from webeye.

wilsoneden avatar wilsoneden commented on July 24, 2024

that file does not exist whenever I check. I suspect it has been deleted when the parent form is disposed.

from webeye.

jacobbo avatar jacobbo commented on July 24, 2024

Also there is a mad suggestion that you're building it in Desktop folder:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/49676009-106c-41f9-ac29-8fb8954fad75/net-40-unauthorizedaccessexception-with-temp-or-appdata-folders?forum=vbgeneral

from webeye.

wilsoneden avatar wilsoneden commented on July 24, 2024

I am not building it in Desktop folder. In fact, it is in folder C:\Users\Wilson Eden\Source\Repos\MyProject.

I've played around a bit more and found the file
System.UnauthorizedAccessException: 'Access to the path 'C:\Users\Wilson Eden\AppData\Local\Temp\tmpA203.tmp' is denied.' and it is not read only.

I found a pattern where the error occurs is when we close the parent form before even the first NewFrame; or in other words, the control is still connecting to the camera (rtsp).

If I wait until the control has connected to the camera and closes the parent form, the error does not occur.

from webeye.

jacobbo avatar jacobbo commented on July 24, 2024

And if you run it as administrator, the issue goes away, doesn't it?

from webeye.

jacobbo avatar jacobbo commented on July 24, 2024

Also, can you reproduce the issue using the demo project?

from webeye.

wilsoneden avatar wilsoneden commented on July 24, 2024

Same results when running it as administrator.
Yes I get the same error using the demo WinForms project (although not always; 1 out of 4 produces the error).

In the StreamPlayerControl.cs:line 139

if (File.Exists(_dllFile))
{
 	File.Delete(_dllFile);
}

what if we add a checking if the file can be deleted.

from webeye.

jacobbo avatar jacobbo commented on July 24, 2024

I do not think this is an authorisation issue, as the exception suggests. My idea is that FreeLibrary call does not release the dll and that is why File.Delete call fails. The most obvious solution for this would be to wrap File.Delete call in try/catch block. Another option is to keep calling FreeLibrary till the File.Delete call succeeds. I can send you binaries for the latter option.

from webeye.

Szanesz avatar Szanesz commented on July 24, 2024

Hello Team,

Im facing the same issue. every time it fails the tmp filename is different,
C:\Users\Sanchez\AppData\Local\Temp\tmp6195.tmp
C:\Users\Sanchez\AppData\Local\Temp\tmp2AE1.tmp
It happens by more kind of trigger, not only at disposing the form.. when i run into a streamfailed or streamstopped event and i recall with webeye_1.StartPlay again it is success in most of the times, but if i run my app for hours it will definetly run into this TMP thing..

Im using the latest version of the nuget (1.0.6), WPF version, with vb.net. I am not building it in Desktop folder either. It comes if i run with admin too.

My knowledge is not enough to touch the suggested 'the StreamPlayerControl.cs:line 139' file... i have no idea how should i start that. I tried to put the .startplay into a trycatch but it didnt help either....

Can you please help me in this?

Thanks!
Peter B (Hungary)

from webeye.

Szanesz avatar Szanesz commented on July 24, 2024

Hello

Adding one thing: i got the error one time at calling webeye_1.stop too.. i hope it helps to find the reason...

P.

from webeye.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.