Is there a x64 bit version of Enterprise Library 5? - 64-bit

I am converting some 32-bit .Net apps to x64. Enterprise Library 5 (32-bit) is used in a bunch of our apps, so I am under the impression that when we re-compile those in x64, then we will need to pull in a x64 version of EntLib. Does anyone know if that exists? I keep searching and I can't seem to find a straight answer - I find burbs about x64 configuration manager tool, but no info about a installable 64-bit version of EntLib5.

The entlib assemblies are architecture neutral. They can be loaded by either 32 or 64 bit processes with no changes.
On a 32-bit process, they'll run as 32-bit. On a 64-bit process, they'll run as 64 bits. No changes needed.
Remember, they're IL, not native code, and don't call into anything native, so there's no bitness dependencies.

Related

Compiling Windows apps for other versions of Windows

Are binaries built on Windows 7 guaranteed to work on 8/Vista, 10, and 11?
Are binaries built on Windows 10 guaranteed to work on Windows 11?
I've seen some things that make me wonder if Windows 11 is still technically Windows 10 in at least some ways that might ensure apps built on Windows 11 be sure to run on Windows 10?
I'm worried not just about the EXE format but for instance the shared library APIs etc. One can build, I'm sure, on a newer Windows and use a DLL, or a function in a DLL, that doesn't exist on the older Windows.
All versions of Windows support the same "Portable Executable" format for EXEs, but it all comes down to (a) the linker settings in the metadata of the binary, (b) the architecture for the processor, and (c) the APIs it needs to import.
If you build a Win32 classic desktop application using _WIN32_WINNT=0x0601, the WINAPI_FAMILY_DESKTOP API partition (the default), and use a recent version of the VC++ toolset, it will set a linker value of "6.00 operating system version". The resulting binary is compatible with Windows 7 SP1, and depending on exactly what APIs you use it might work on Windows Vista SP2 as well. It will also be forward compatible to Windows 8.x, Windows 10, and Windows 11.
Both x86 and x64 Windows support 32-bit applications, although x64 Windows does not support super-old 16-bit Windows programs that technically work on 32-bit Windows.
There are many application compatibility bugs that can make a program that should technically work on a newer version of Windows fail, but these can be avoided by just testing on newer versions of the OS before shipping.
Officially the modern VC++ toolsets, the Visual C/C++ Runtime, and Windows SDKs do not support Windows Vista, Windows 7 RTM, or Windows 8.0 development.
See Microsoft Docs.

Uninstall 32 bit application and install 64 bit application

Is there a posibility to tell Innosetup to uninstall the 32 bit version of the application (that usually resides in Program Files (x86)) in order to install the 64 bit version of the application (usually in Program Files). If the 32 bit version is not uninstalled, then bot of them will start at startup, causing problems.
I don't know if there is a procedure for this. Given the fact that the 64 bit application will basically be a different application, trying to uninstall the 32 bit application seems like trying to uninstall a non-related application.
The motivation will be that less and less vendors offer support for 32 bit libraries. For example, there are no 32 bit libraries for Qt for msvc2017. So the earlier I move to 64 bit the better.
Note: if this is not possible in Innosetup, any other alternative is welcome.
Just uninstall the previous 32-bit version, as any other.
See How to detect old installation and offer removal?
It should work almost out-of-the-box, as long as both the installers for 32-bit and 64-bit version have the same AppId. The only difference is that you need to look to for the uninstall key explicitly in HKLM32 (32-bit hive) instead of HKLM/HKEY_LOCAL_MACHINE (which defaults to 64-bit hive in 64-bit install mode).
If you uninstall the 32-bit version from InitializeSetup already, as the accepted answer to the above question shows, Inno Setup won't notice that the 32-bit version ever existed and will even "reset" the default installation path to the 64-bit Program Files folder.

Deploying Crystal Reports for Visual Studio on Windows 7 64 bit systems via Clickonce

I have written an application that uses CR for Visual Studio. It deploys and runs fine on 32 bit systems. I want it to work on 64 bit systems too, so I ran CRRuntime_64bit_13_0_7.msi to install the redistributable.
When I select my prerequisites in VS 2012, should I see an entry for CR 64 bit? I don't.
In VS, I set the target CPU to x64 and publish (Clickonce). When I try to install it on my Win 7 64 bit system, I get an error:
Unable to install or run the application. The application requires that assembly CrystalDecisions.ReportAppServer.CommonObjectMode Version 13.0.2000.0 be installed in the Global Assembly Cache (GAC) first.
How can I deploy the 64 bit CR runtime with my application?
Thanks
Maybe there's a bug with the Service Pack 7 version of the files? Have you tried with the Service Pack 8 version that was recently released?
SAP Crystal Reports, Developer version for Microsoft Visual Studio
Is your development environment 32-bit or 64-bit? Because that might have a bit to do with it also. Installing and deploying Crystal has always been a pain (I've been working with it since version 7.0) and to introduce the complexity of 32/64-bit makes it even more fun!
Another thing to point out on that link was that you have to run the "Install executable" to get it to integrate into VS properly. When I did so, it asked me if I wanted to install the 64-bit runtime as my PC was 64-bit, did you get to this point and if so, which version did you choose?
In the app we're working on, we have a routine that inspects all assemblies in the dependencies folder and auto-loads classes with a certain attribute, but when I went to run the app targeting a 64-bit CPU (or even Any CPU) it would give me exceptions when trying to load the Crystal Reports assemblies on start-up, but it would work fine when targeting a 32-bit CPU.
Which leads me to think that perhaps they either don't have their 32/64-bitness sorted properly, or their installer isn't doing what it says it is.

Which VC++ redistributable package to choose (x86 or x64)?

Is the package type (x86 or x64) dependent on my application type or on the OS type it is installed on?
I.e., if I develop a 32-bit application do I need to
deploy the x86 package only or
deploy both packages and install x86 on 32-bit windows and x64 on 64-bit windows?
The answer to this question 32-bit VC++ redistributable on 64 bit OS? suggests that it's only the x86 package, so it would be dependent on my application but it doesn't give any explanation/links.
The MS download sites are also not specific on this.
When you compile, all use of the standard library creates references that must be resolved at link time. The linker bakes in the import library for the matching runtime DLL(s), which must be matched completely at load time. That means matching the compiler version, service pack, and bitness.
Also remember that a 32-bit process cannot load 64-bit DLLs. Because the 64-bit redist only contains 64-bit DLLs, it is of no help when loading a 32-bit executable.
it depends on the application if you need to maximize the potential of 64-bit OS, you may deploy both for handling 64-bit and 32-bit processing. However, if your application did not exceed the limits of 32-bit, you may deploy the application on x86 only, anyway it should also work on 64-bit OS via 32-bit virtualization.

Is code written in Vista 64 compatible on 32 bit os?

We are getting new dev machines and moving up to Vista 64 Ultimate to take advantage of our 8gb ram. Our manager wants us to do all dev in 32bit virtual machines to make sure there will be no problems with our code moving into production.
Is there any way to guarantee the resultant programs will work on 32bit os's?
I don't mind using virtual machines, but I don't like how they force you back into a "Single" monitor type view. I like moving my VS toolbars off to my other monitor.
EDIT: We are using Visual Studio 2005 and 2008, VB.NET and/or C#
EDIT: Using Harpreet's answer, these are the steps I used to set my Visual Studio IDE to compile x86 / 32bit:
Click Build and open Configuration Manager
Select Active Solution Platform drop down list
Select x86 if it is in the list and skip to step 5, if not Select <New...>
In the New Solution Platform dialog, select x86 and press OK
Verify the selected platform for all of your projects is x86
Click Close.
Enjoy.
Thank you,
Keith
I do development on 64 bit machines for 32 bit Windows. It's not a problem. You should make sure that your projects are set to compile in x86 mode in order to be conservative. You'll want to go through each project in the solution and double check this. You could also use the AnyCPU setting but that's a little riskier since it will run differently on your dev machine than a 32 bit machine. You want to avoid the 64bit mode, of course.
The problems I've run into are drivers that don't work when the app is compiled for 64 bit (explicitly 64 bit or AnyCPU compiled and running on 64 bit Windows). Those problems are completely avoidable by sticking with x86 compilation. That should reveal all flaws on your dev machines.
Ideally, you could set up a build and test environment that could be executed against frequently on a 32 bit machine. That should reassure your management and let you avoid the VM as your desktop.
As long as you compile your executables as 32 bit, they will run on both 32 bit and 64 Windows machines (guaranteed). Using 64 dev machines has the advantage that you can start testing your code with 64 bit compilation (to check for things like pointers casted to 32 bit integers), this way making the transition to 64 bit easier in the future (should you your company choose to do a 64 bit version).
Compiling for a 64bit OS is an option in the compiler. You can absolutely compile to a 32bit exe from within Vista 64 bit. When you run the app, you can then see in the TaskManager that there is a "*32" next to the process...this means it's 32bit ;)
I believe your managers need some more education on what 64bit OS really means :)
Not an answer to your question, but possibly a solution to your problem: VirtualBox (and probably others) supports "seamless integration" mode, which just gives you a second start bar and lets you drag windows around freely.
Also, and this is an answer to your question, it depends on your compile settings. You can compile for different environments, and you can perfectly compile 32-bit programs on a 64-bit system with Visual Studio. Can't tell you how, but I'm sure some Visual Studio guru could help you out.
We develop a 32-bit application using VS 2005 (2008 soon) and have just purchased some new machines with XP Pro x64 or Vista Business 64-bit on them so that we can take advantage of the extra RAM whilst holding a watching brief on the possibility of doing a 64-bit port if it becomes commercially necessary to do so. We haven't had any problems with doing this other than tweaking some scripts in our development environment etc.
Those developers who weren't included in this upgrade cycle still use 32-bit machines, so these should pick up problems when the unit tests and the application test suite are run as a matter of course before a check-in.
What we also do is to make sure that we have a set of "test build" machines made up of "typical" configurations (XP/Vista, 2/4/8 cores, etc.) that build and test sets of check-ins - we have various different test suites for stability, performance, etc. - before they are added to the integration area proper. Again, these haven't picked up any problems with running a 32-bit application built on a 64-bit OS.
Anyway, as others have already said, I wouldn't expect it to be a problem because it's the compiler that generates the appropriate code for the target OS regardless of the OS that the compiler is actually running on.
yeah, like adam was saying. There's 3 options: MSIL (default), x64, and x86. You can target x64 and it will generate dll's specifically for 64-bit systems, or you can do x86 which will run on 32-bit and 64-bit, but will have the same restrictions as 32-bit on a 64-bit system.
MSIL will basically let the JITer issue the platform specific instruction (at a slight performance penalty compared to a native image)
EDIT: no language, so i'm talking about .net framework languages like vb.net and c#, c++ is a completely different animal.
Found this today:
http://www.brianpeek.com/blog/archive/2007/11/13/x64-development-with-net.aspx
x64 Development with .NET
Earlier this year I made the switch to a 64-bit operating system - Vista Ultimate x64 to be exact. For the most part, this process has been relatively painless, but there have been a few hiccups along the way (x64 compatible drivers, mainly, but that's not the point of this discussion).
In the world of x64 development, there have been a few struggling points that I thought I'd outline here. This list will likely grow, so expect future posts on the matter.
In the wonderful world of .NET development, applications and assemblies can be compiled to target various platforms. By default, applications and assemblies are compiled as Any CPU in Visual Studio. In this scenario, the CLR will load the assembly as whatever the default target is for the machine it is being executed on. For example, when running an executable on an x64 machine, it will be run as a 64-bit process.
Visual Studio also provides for 3 specific platform targets: x86, x64 and Itanium (IA-64). When building an executable as a specific target, it will be loaded as a process of that type. For example, an x86-targeted executable run on an x64 machine will run as a 32-bit process using the 32-bit CLR and WOW64 layer. When assemblies are loaded at runtime, they can only be loaded by a process if their target matches that of the hosting process, or it is compiled as Any CPU. For example, if x64 were set as the target for an assembly, it can only be loaded by an x64 process.
This has come into play in a few scenarios for me:
XNA - XNA is available as a set of 32-bit assemblies only. Therefore, when referencing the XNA assemblies, the executable/assembly using them must be targeted to the x86 platform. If it is targeted as x64 (or as Any CPU and run on a 64-bit machine), an error will be thrown when trying to load the XNA assemblies.
Microsoft Robotics Studio - The XInputGamepadService uses XNA internally to talk to the Xbox 360 controller. See above.
Managed DirectX - While this is already deprecated and being replaced with XNA, it still has its uses. The assemblies are not marked for a specific target, however I had difficulty with memory exceptions, especially with the Microsoft.DirectX.AudioVideoPlayback assembly.
Phidgets - Depending on what library you download and when, it may or may not be marked as 32-bit only. The current version (11/8/07) is marked as such, and so requires a 32-bit process to host it.
The easiest way to determine if an executable or assembly is targeted to a specific platform is to use the corflags application. To use this, open a Visual Studio Command Prompt from your Start menu and run it against the assembly you wish to check.
The easiest way to determine if an executable or assembly is targeted to a specific platform is to use the corflags application. To use this, open a Visual Studio Command Prompt from your Start menu and run it against the assembly you wish to check.

Resources