Results 1 to 11 of 11

Thread: Publishing a Visual Basic Net application

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2019
    Posts
    92

    Publishing a Visual Basic Net application

    If I understand Publishing correctly, I have an option to make the application available offline or only online.

    I wish to make the application available offline When the application is installed on a users machine the executable is installed along with library files in a sequence of folders containing "AppData/Local/2.0" etc.

    I would like the executable to be located elsewhere and separate for all the library files.

    When I move it, It opens and runs, but as I move through it I get an error as shown on the attached image.

    Name:  FatalError.JPG
Views: 135
Size:  25.2 KB

    If I run it from its installed location then I don't get the error.

    If I were to install it as available only online, could I then copy the executable from my projects "\bin\Debug" folder and place it where ever I want on the users computer?

    Any suggestions?

    Richard

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,282

    Re: Publishing a Visual Basic Net application

    If your application uses the PowerPacks library then the PowerPacks library has to be available to use when you run your app. If that library is not included in the published package and it's not separately installed on the machine then your installed app won't run.

    Start by checking the Publish page of the project properties and see whether the PowerPacks library is included and/or available as an option. Check the prerequisites and see whether PowerPacks is an option to include. If it is and you include it then PowerPacks can be downloaded and installed along with your app. Alternatively, you can ensure that the reference for the PowerPacks is copied locally and then you should be able to include it in the Publish, if it isn't automatically.

    By the way, this is not a VB.NET question. This site has an Application Deployment forum for a reason. I have asked the mods to move this thread there.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2019
    Posts
    92

    Re: Publishing a Visual Basic Net application

    Thank you, I hope my response is directed to the Application Deployment site.

    I The PowerPacks Library is automatically included in the distribution.

    When I check a computer where the application is installed, I can see it was installed along with all the other dlls etc.

    Name:  PowerPacksInstall.jpg
Views: 102
Size:  20.5 KB

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,282

    Re: Publishing a Visual Basic Net application

    Are you saying that the PowerPacks DLL was already there when the error occurred?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2019
    Posts
    92

    Re: Publishing a Visual Basic Net application

    Yes, it was already in place.

    All I did was to move the executable, that was in that same folder as the library files, to a different place.

    The program would open up and behave normally up to the point where I changed from a form that was displaying two DataGridViews, to a form where drawing occurred.

    If the program was left in its original location, it would behave properly.

    I am guessing that under some instances certain library files are registered locally and uniquely to that application. Which means to me that they are not registered as shared, or perhaps not registered at all. But I am relying on my VB6 Windows 7 experiences to hazard this guess and have no formal training in this matter.

    The attached image shows how that particular file was published

    Name:  Applicationfiles.jpg
Views: 79
Size:  28.9 KB
    Last edited by Richard Friedman; Jan 17th, 2021 at 08:03 AM.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,282

    Re: Publishing a Visual Basic Net application

    Quote Originally Posted by Richard Friedman View Post
    All I did was to move the executable, that was in that same folder as the library files, to a different place.
    Why on Earth would you do such a thing? You install an application and then move a file and wonder why it doesn't work? smh

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    33,206

    Re: Publishing a Visual Basic Net application

    All I did was to move the executable, that was in that same folder as the library files, to a different place.
    Then that was your mistake... at that point your app and needed libraries are no longer in the same loction and the app has no way of locating them. Bottom line, you too the fuel tank out of your car and moved it to another garage, and still expect your engine to still run. That's not how it works. How would your engine know where to find the fuel tank? By the same reason, once you moved the app,you effectively broke the rules of reference and separated the parent from the child and now they can't find each other. The reason it even starts up and gets as far as it does is because a large part of the .NET libraries is loaded into the GAC, Global Access Cache... this is the universally used stuff located in one place so you don't end up with 20 copies of the .NET libraries on your HD. But the PP isn't installed there, at least not by default.
    That said, you might be able to set the flags so that the PP libraries are installed into the CAG, making it universally available, then you can move your app to your hearts content.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Nov 2019
    Posts
    92

    Re: Publishing a Visual Basic Net application

    Excellent,

    In the VB6 Windows 7 World the library files were installed in the windows /System /System32 / or /SysWOW64 folders and any program could get to them.

    In that VB6 world I developed a suite of programs and put all the executables in a single folder for easy access by the user.

    I was hoping to do the same now that I have moved over to NET.

    Can I be directed to information relating to setting flags so that the libraries are stalled in the CAG.

    Many thanks

    Richard

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Nov 2019
    Posts
    92

    Re: Publishing a Visual Basic Net application

    Here’s the Big Picture

    Years ago, I developed a suite of VB6 engineering programs that I made available to all the engineers in my company. I placed the executables in a folder system according to their category on the main company server. Each engineer had a copy of that folder structure and programs on their own computer in a defined universal location that could be accessed offline. They were accessed through a TreeView program that read and displayed the directory so that they could click on a program from the TreeView program and launch that executable, video ,excel file, etc.

    When the user activated the TreeView program and they were online, the TreeView program would run through a compare operation comparing names and dates and update the users computer with the latest programs.

    In this environment all the library files were added to the Windows\System,32,WOW64 folders so that launching any program from the TreeView program was effective.

    Now that I have migrated one of these programs over to the Net environment, I see that much has changed in that the application and its library files now reside in the users AppData folder and are inseparable. Perhaps I could live with this by using Shortcuts in the TreeView application.

    From time to time I would update the application without changing the reference library files and need to update that executable on the users machine by the process outlined above. This process falls apart with the NET installation method. I see many warnings about placing library the files to the GAC and am looking for suggestions.

  10. #10
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,282

    Re: Publishing a Visual Basic Net application

    You should not be using ClickOnce for a start. ClickOnce apps are installed in the ClickOnce cache. If you don't want to run an application in the ClickOnce cache then don't install it there. If you want all your applications in a specific place then put them there. If you want to install your libraries to a common location then that's the Global Assembly Cache (GAC) for .NET so you need to learn how to do that. Start researching how to do that. If you use Windows Installer then you can install an application to the Program Files folder - under a specific subfolder if desired - and install libraries to the GAC. There is a Setup Projects extension available for recent versions of VS that enables you to create a Windows Installer for your app.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Nov 2019
    Posts
    92

    Re: Publishing a Visual Basic Net application

    I was not able to find a resource for Publishing that would install all the projects library files in the GAC during a software installation. I did find examples for creating a single dll and installing that in the GAC.

    The ClickOnce installation places all the library files and the executable in a user specific path. I am guessing that none of these libraries are registered but are treated as local to the executable. I have found no way to change the installation path in the Publish settings (VS2019)

    I made a copy of that entire folders contents and placed it in a non-user specific location that suited my needs, and it ran with no problems. This may solve my issues. I did notice a group of individual directories one level above the directory that I copied. Each of these directories had copies of one of the library files that were in the directory that I copied. I did not move that structure to the non-user specific location. I suspect they are there for repair operations.

    Would anybody care to comment on my unorthodox maneuvers?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width