-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create/update bundles fails with System.UnauthorizedAccessException #22
Comments
I don't use Azure DevOps, but it looks like your machine or source control has the files locked so that they cannot be edited. There's no way the Extension can bypass a System.UnauthorizedAccessException, can you try checking out all the required files before running the extension? |
How does it work when an already minified file is edited? For example file.js is bundled and minified to file.min.js. When both are checked in and file.js is edited, VS automatically checks out the file. And the min.js file is also checked out.
It worked fine in previous versions of VS.
But the big issue is not the System.UnauthorizedAccessException, why are ALL bundled files minified when adding a new bundle even though no other source files changed?
…________________________________
From: Jason Moore ***@***.***>
Sent: Wednesday, May 31, 2023 12:30:23 PM
To: failwyn/BundlerMinifier ***@***.***>
Cc: amilo2003 ***@***.***>; Author ***@***.***>
Subject: Re: [failwyn/BundlerMinifier] Create/update bundles fails with System.UnauthorizedAccessException (Issue #22)
I don't use Azure DevOps, but it looks like your machine or source control has the files locked so that they cannot be edited. There's no way the Extension can bypass a System.UnauthorizedAccessException.
—
Reply to this email directly, view it on GitHub<#22 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFOZI6GA6P6L7ZACXXVAIHLXI4MT7ANCNFSM6AAAAAAYDDEMW4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There's only one bundleconfig.js file and when that file is modified, all of the bundles defined in it are updated. I just don't have any experience with Azure DevOps, so I don't know if it keeps all files locked until checkout, but the file could just be locked by another process; can you try doing a full reboot, opening Visual Studio, right click bundleconfig.json, select Bundler & Minifier -> Update Bundles and see if it works? |
Same error. Somehow VS does not recognize the attempt to modify the .min files as triggered from the IDE and does not check the necessary files out.
System.UnauthorizedAccessException: Access to the path 'D:\Visual Studio\Project\Solution\Web\wwwroot\js\lookup.min.js' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.File.OpenFile(String path, FileAccess access, SafeFileHandle& handle)
at System.IO.File.SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
at BundlerMinifier.BundleFileProcessor.ProcessBundle(String baseFolder, Bundle bundle) in W:\Git\Light Speed Solutions\BundlerMinifier\src\BundlerMinifier.Core\Bundle\BundleFileProcessor.cs:line 140
at BundlerMinifier.BundleFileProcessor.Process(String fileName, IEnumerable`1 bundles) in W:\Git\Light Speed Solutions\BundlerMinifier\src\BundlerMinifier.Core\Bundle\BundleFileProcessor.cs:line 40
at BundlerMinifierVsix.BundleService.<>c__DisplayClass8_0.<Process>b__0(Object o) in W:\Git\Light Speed Solutions\BundlerMinifier\src\BundlerMinifierVsix\BundleService.cs:line 112
From: Jason Moore ***@***.***>
Sent: Wednesday, May 31, 2023 2:59 PM
To: failwyn/BundlerMinifier ***@***.***>
Cc: amilo2003 ***@***.***>; Author ***@***.***>
Subject: Re: [failwyn/BundlerMinifier] Create/update bundles fails with System.UnauthorizedAccessException (Issue #22)
There's only one bundleconfig.js file and when that file is modified, all of the bundles defined in it are updated. I just don't have any experience with Azure DevOps, so I don't know if it keeps all files locked until checkout, but the file could just be locked by another process; can you try doing a full reboot, opening Visual Studio, right click bundleconfig.json, select Bundler & Minifier -> Update Bundles and see if it works?
—
Reply to this email directly, view it on GitHub <#22 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFOZI6HW2R6TMZ4YTO55OEDXI46BNANCNFSM6AAAAAAYDDEMW4> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AFOZI6FGWKQGT4JK43PTXQDXI46BNA5CNFSM6AAAAAAYDDEMW6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS5S4V5U.gif> Message ID: ***@***.*** ***@***.***> >
|
Installed product versions
Description
Creating a new bundle fails when the solution is bound to source control, in this case Azure Devops.
Steps to recreate
Current behavior
Creating a new bundle fails with dialog message below when the solution is bound to source control, in this case Azure Devops.
Microsoft Visual Studio
Access to the path 'D:\Visual Studio\Test\Project\bundleconfig.json' is denied.
OK
If a .min file already exists, the .min file is automatically checked out, but bundleconfig.json is not automatically checked out.
If bundleconfig.json is checked out, creating a new bundle fails although the entries are created in bundleconfig.json. The target bundle is not created unless ALL bundles in bundleconfig.json are checked out for editing, even nothing when changed. Error message:
System.UnauthorizedAccessException: Access to the path 'D:\Visual Studio\Test\Project\wwwroot\js\custom-validation.min.js' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.File.OpenFile(String path, FileAccess access, SafeFileHandle& handle)
at System.IO.File.SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
at BundlerMinifier.BundleFileProcessor.ProcessBundle(String baseFolder, Bundle bundle) in W:\Git\Light Speed Solutions\BundlerMinifier\src\BundlerMinifier.Core\Bundle\BundleFileProcessor.cs:line 140
at BundlerMinifier.BundleFileProcessor.Process(String fileName, IEnumerable`1 bundles) in W:\Git\Light Speed Solutions\BundlerMinifier\src\BundlerMinifier.Core\Bundle\BundleFileProcessor.cs:line 40
at BundlerMinifierVsix.BundleService.<>c__DisplayClass8_0.b__0(Object o) in W:\Git\Light Speed Solutions\BundlerMinifier\src\BundlerMinifierVsix\BundleService.cs:line 112
Expected behavior
Necessary bundled files should be checked out automatically.
The text was updated successfully, but these errors were encountered: