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 6705615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:25:28+00:00 2026-05-26T07:25:28+00:00

In a .NET Compact Framework 3.5 application I’m doing a version check in a

  • 0

In a .NET Compact Framework 3.5 application I’m doing a version check in a fairly tight loop in order to know whether or not another assembly needs to be “upgraded” (have a new copy in another directory copied over it, then start it up again).

The problem is that Assembly.LoadFrom(path).GetName().Version locks the file and prevents said copying over.

AssemblyName.GetAssemblyName(path) would be a better way to get this (thanks to this SO answer), as it doesn’t permanently load the assembly into the AppDomain and thus doesn’t lock the file, but it isn’t available in the Compact Framework.

I could create a new AppDomain, but can’t use the new domain’s Load method as that’s not supported in the Compact Framework.

As a last resort I thought I’d allow the assembly to actually be loaded with the Assembly.Load(byte[]) overload, which would cause a massive memory “leak” in a tight loop since they’re never unloaded. To counter that I intended to first hash the assembly’s byte array and check a cache of versions for a previous hit. However, you guessed it, the byte array overload for Assembly.Load() isn’t supported in the Compact Framework.

I also considered adding AssemblyFileVersions, since they’re easier to check anyway, but that’s another thing in the growing heap of things not supported in the Compact Framework (my thanks to this SO answer for not having to try this).

Please, tell me what I’m trying to do is possible so I stop hating this framework so much?

  • 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-26T07:25:28+00:00Added an answer on May 26, 2026 at 7:25 am

    I think you are going to have to P/Invoke GetFileVersionInfo, GetFileVersionInfoSize, and VerQueryValue to get what your want. The pinvoke.net site is a great tool for signatures and examples on such things. They have GetFileVersionInfo prototyped, but not the others. Let me know if you need help with them and I can probably get the signatures that will work.

    http://pinvoke.net/default.aspx/coredll/GetFileVersionInfo.html

    Also noticed the OpenNETCF library has this implemented in the OpenNETCF.Diagnostics.FileVersionInfo class. So you can download that library and see how they did it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application is targeted for Compact .Net 1.0 framework. The application has to check
How to know that a control is loaded in .Net Compact Framework, WinForms application?
When moving my .Net Compact Framework application to the SD-card of a Windows CE
Here's my problem. I'm currently trying to develop a .Net Compact Framework 2.0 application
I'm building a mobile application in VB.NET (compact framework), and I'm wondering what the
How to apply scrollbar to windows mobile application using .net compact framework, and windows
I'm building an application with the .NET Compact Framework v3.5 with C# using Visual
I'm developing a application for Windows Mobile using C#(.Net Compact Framework 3.5), but I
I want to downgrade a Windows Mobile application made with .Net Compact Framework 3.5
I'm developing a Windows Mobile 5.0 and above application using .Net Compact Framework 2.0

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.