Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5961915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:01:57+00:00 2026-05-22T19:01:57+00:00

I’m creating an application in C# using Visual Studio 2010/.NET 4.0. For part of

  • 0

I’m creating an application in C# using Visual Studio 2010/.NET 4.0. For part of the application I need to zip the files and make use of the J# library. I’m having an issue importing kernal32.dll. I’ve tried setting the import value to “kernal32”, “kernal32.dll” and the absolute path in the system32 folder. The error I get is below and the relevant source code is below that. The error occurs at the line where I invoke “LoadLibrary(fullPath);” Any help would be greatly excavated!

I pulled some of this code from an example at http://blogs.windwardreports.com/davidt/2011/02/calling-j-code-from-net-40.html

System.DllNotFoundException was unhandled
Message=Unable to load DLL ‘kernal32’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=ZipLibrary
TypeName=””
StackTrace:
at ZipLibrary.Zipper.LoadLibrary(String ipFileName)
at ZipLibrary.Zipper..ctor(String directoryToZip, String zipToPath) in c:\users\cchamberlain\documents\visual studio 2010\Projects\AppDeploy\ZipLibrary\Zipper.cs:line 37
at AppDeployLibrary.AppDeployer.Deploy() in c:\users\cchamberlain\documents\visual studio 2010\Projects\AppDeploy\AppDeployLibrary\AppDeployer.cs:line 37
at AppDeploy.Program.Main(String[] args) in c:\users\cchamberlain\documents\visual studio 2010\Projects\AppDeploy\AppDeploy\Program.cs:line 21
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

public class Zipper
{
    private const string DotNetFrameworkRelativePath = @"..\Microsoft.NET\Framework\v2.0.50727";
    private const string VjsDllName = "vjsnativ.dll";

    [DllImport("kernal32", SetLastError=true)]
    static extern IntPtr LoadLibrary(string ipFileName);

    private readonly string _directoryToZip;
    private readonly string _zipToPath;

    public Zipper(string directoryToZip, string zipToPath)
    {
        // If the current framework is .NET 4, include the VJS dll.)))
        if(Environment.Version.Major >= 4)
        {
            string folder = SystemIO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), DotNetFrameworkRelativePath);
            folder = SystemIO.Path.GetFullPath(folder);
            string fullPath = SystemIO.Path.Combine(folder, VjsDllName);

            // Check to see if file exists, if not the J# redistributable is not installed.
            if(!SystemIO.File.Exists(fullPath))
            {
                throw new ApplicationException("ERROR: Zipper requires that the Microsoft Visual J#® 2.0 Redistributable Package be installed on the environment.");
            }

            LoadLibrary(fullPath);
        }

        _directoryToZip = directoryToZip;
        _zipToPath = _zipToPath;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:01:58+00:00Added an answer on May 22, 2026 at 7:01 pm

    Try kernel32. Example below via the P/Invoke LoadLibrary page.

    [DllImport("kernel32", SetLastError=true)]
    static extern IntPtr LoadLibrary(string lpFileName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.