none
ClickOnce Permissions Issue? FileIO RRS feed

  • Question

  • I'm having a problenm deploying a ClickOnce application.  I have a large program that's being deployed 'ONLINE ONLY' to a network share.  I reference the updates and program on the network share.  To install on client computers, I create a shortcut to the network share.  When running the program, the files download to the client and the program runs correctly.

    There are sections of the program that create files on either the client machine or a network share.  It seems like anything that I have written in my code works fine and creates the files as it's supposed to.  I'm using a 3rd party component that creates pdf files from a report (DataDynamics Active Reports) and saves them... that works fine too.

    I'm also using a 3rd party component to capture images from a scanner.  That component doesn't work.  I get an error when trying to save files.  I'm also using vjslib.dll to create a zip file.  That doesn't work either.  I get an error when trying to save the file.  The errors are very vague and basically amount to "Unable to save file".

    After my testing / research I've found that it can't be a permissions issue in my deployment (I think) because some of the file IO works.  I think I read that ClickOnce with my deployment get LocalIntranet permissions.  Those don't include FileIO, but since some work, I'm lost.

    Basically, I guess I'm asking if anyone knows of any issues with ClickOnce, file IO, and network deployments.  I've also tried giving LocalIntranet FullTrust on a test computer, but got the same errors.

    Finally, all of the areas that give me errors when deployed work fine locally on my development machine (not over the network).  I keep going back and forth between permissions / not permissions.

    Thanks,
    Any help would be appreciated...
    John


    Longtime VB6 (and 5 and 4) Programmer, New to .NET
    • Moved by Jeff Shan Thursday, February 18, 2010 6:32 AM for better support (From:Visual Basic IDE)
    Tuesday, February 16, 2010 10:41 PM

Answers

  • Hi John,

    It's probably okay writing it to a network share. What I don't think will work is the C:\test.rtf. If I were you, I would count my blessings, and move the location of that file. Are you running on Windows XP? Because I don't think Vista or Windows Fabulous (7) will let you do that.

    Having said that, can you change the location that the 3rd party dll's are writing output to and try it? I still think that's your problem.

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Tuesday, February 23, 2010 11:03 PM
    Moderator
  • Robin,

    Thanks for your time and assistance.  I've tested this problem over and over to try and figure it out.

    One of the dlls, MS J# library (vjslib.dll) CANNOT write to a network share, local dirve, or My Documents folder.

    One of the 3rd party apps (DataDynamics Active Reports) CAN write anywhere (local, network, my documents).

    My code CAN write anywhere.

    I've also tested in WinXP and 7 and they both function the same.  So, while I still don't have a solution, the best fix is to get rid of the MS library and write it myself (never thought I'd say that... haha).

    John
    Longtime VB6 (and 5 and 4) Programmer, New to .NET
    • Marked as answer by johnrou Wednesday, February 24, 2010 6:53 PM
    Wednesday, February 24, 2010 6:53 PM

All replies

  • Post this issue in clickonce forum for better responses http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads

    kaymaf
    If that what you want, take it. If not, ignored it and no complain

    CODE CONVERTER SITE : http://www.carlosag.net/Tools/CodeTranslator/.

    Wednesday, February 17, 2010 11:11 PM
  • Hi, John,

    Are you deploying your application as full trust? (This is in the security tab).

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Monday, February 22, 2010 6:25 AM
    Moderator
  • I am deploying using full trust... It's deployed over our LAN.

    It's strange that the vjslib doesnt work, but another 3rd party dll does work.  I previously deployed without using ClickOnce and everything worked fine...

    John
    Longtime VB6 (and 5 and 4) Programmer, New to .NET
    Monday, February 22, 2010 6:58 PM
  • Hi John,

    Where is it trying to save the files? ClickOnce applications do not have administrative privileges, and can only write to file locations under the user's profile and in folders such as MyDocuments.

    If it's trying to write to a folder on the C drive, for example, you won't be able to do that.

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Tuesday, February 23, 2010 7:33 PM
    Moderator
  • Hi Robin,

    I thought the same thing, but another location in my program the following code executes without error:

    txtRTFBox.SaveFile("C:\test.rtf", RichTextBoxStreamType.RichText)
    txtRTFBox.SaveFile(\\networkserver\Saves\test.rtf, RichTextBoxStreamType.RichText)


    It really seems like the problem is limited to some 3rd party dll's... even if created by MS...

    Any other ideas?

    John


    Longtime VB6 (and 5 and 4) Programmer, New to .NET
    Tuesday, February 23, 2010 9:10 PM
  • Hi John,

    It's probably okay writing it to a network share. What I don't think will work is the C:\test.rtf. If I were you, I would count my blessings, and move the location of that file. Are you running on Windows XP? Because I don't think Vista or Windows Fabulous (7) will let you do that.

    Having said that, can you change the location that the 3rd party dll's are writing output to and try it? I still think that's your problem.

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Tuesday, February 23, 2010 11:03 PM
    Moderator
  • Robin,

    Thanks for your time and assistance.  I've tested this problem over and over to try and figure it out.

    One of the dlls, MS J# library (vjslib.dll) CANNOT write to a network share, local dirve, or My Documents folder.

    One of the 3rd party apps (DataDynamics Active Reports) CAN write anywhere (local, network, my documents).

    My code CAN write anywhere.

    I've also tested in WinXP and 7 and they both function the same.  So, while I still don't have a solution, the best fix is to get rid of the MS library and write it myself (never thought I'd say that... haha).

    John
    Longtime VB6 (and 5 and 4) Programmer, New to .NET
    • Marked as answer by johnrou Wednesday, February 24, 2010 6:53 PM
    Wednesday, February 24, 2010 6:53 PM
  • That's really odd. Maybe they have some restriction in the code for that dll that doesn't allow what you're trying to do.

    Do you have ACLs turned off on Windows 7? If you try to write to something like the Program Files folder, does it let you? (it shouldn't). (Just wondering.)

    Good luck.

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Thursday, February 25, 2010 8:04 PM
    Moderator
  • Yes, I can write to any location (in my code).  I only use Win7 for development, but the behavior replicates to WinXP too.

    I was working with another 3rd party vendor all week last week about this issue.  Thier control would not allow the saving of files to any location.  After about a week of working on it, we found it was a packaging issue.  After that was modified, everything is happy.

    You don't think MS would re-package vjslib.dll for me do you? :)

    Longtime VB6 (and 5 and 4) Programmer, New to .NET
    Tuesday, March 2, 2010 3:58 PM
  • I am having this exact same problem!  How did you solve it?

    Strangely a 3rd party library has permissions problems in the clickonce deployment.  In my code I have no problem writing or doing anything, and yet if the program is running from the appdata\local\apps\2.0\ folder it causes the 3rd party to break.  I can copy the same code to another place and it works fine.  You said this was a packaging issue.  Could you please elaborate or point me to some possible way I might solve this?

    Tuesday, October 2, 2012 3:31 AM