Can't install the project after added Prerequisites NET 4.6 - c#

I used Visual Installer project to deploy.
After I added .NET 4.6 components to my project and built it, I didn't got click to install option, to check this in Visual studio.
But after deleting this everything worked again.

Download Prerequisites: I would set the prerequisite to download from the vendor's web site - that is the first option of those 3 in your screen shot - at least in my English Visual Studio Setup Project. I don't read Russian / Cyrillic I am afraid. Those letters really look like an alien language :-).
Eliminate Embedded Prerequisites (for common runtimes): My rant about including the .NET framework is generally that what you include is 1) outdated in no time with all the security fixes (hence bloating your setup for no reason?) and 2) the new Windows OS versions are including .NET pre-installed outright (albeit perhaps not in the correct version). 3) .NET is also installed via Windows Update now - for home users (eventually, there is some delay in release), and 4) corporate packagers absolutely hate pulling packages apart to remove common runtimes since they have to use standard corporate packages for these runtimes and are not allowed to use the bundled ones. Just a report from those who receive vendor setups. Keep it simple. Prefer to document what your setup does? Providing simple Readme.txt or Deployment Info.pdf is good. Delivering a special setup for corporations and large scale deployment is another good way to do it (just a zip of prerequisites and the actual setup).
Launch Condition: A simple launch condition telling the user to install the .NET framework and what version might be enough, but maybe your "download from vendor site" is best?
.NET Runtime: As a side-note - and I guess this is well known for most - just pointing it out to whoever might read this: There have been way fewer versions of the .NET runtime (CLR) than is commonly perceived. There is the framework, and then there is the runtime. Please see .NET expert and overall computer expert Hans Passant's summary here (and the other answers on the page too). One more. Version 1.0 and 1.1 of the CLR would seem to be largely irrelevant by now?
Alternative Tools: I have long disliked Visual Studio Installer Projects. Just throwing in a link to alternative MSI tools.

Related

Installshield without installing required software window first

I created a setup project that has as required software .NET 4.5. Right now if I don't have installed .net 4.5 the installation will start with installing .net framework first. I would like to avoid this behavior and to receive directly an error message saying that I don't have installed .net version on my computer. Is that possible?
Thank you in advance.
Regards,
Vlad
It sounds like you have enabled the .NET 4.5 prerequisite. Prerequisites are designed to check the machine and conditionally install a redistributable before the main installation begins.
The flip side of this is a Launch Condition, at least in a basic MSI project. Use a System Search to detect whether .NET 4.5 is present (feel free to edit the .NET 4.5 prerequisite to get an idea what to look for, or just research it yourself), and add a Launch Condition with the message you want to show.
It's actually a really good idea to set up the Launch Condition even if you are including the prerequisite, just in case someone launches the .msi file without going through setup.exe's prerequisite checks. And for your case, where you don't want to offer the automatic installation, just stop including the prerequisite.

Install C# application on user system with system libraries

I have created a C# 2010 application and now when I install it on user application it asks for complete dot net framework. Is it possible if I can only put required dll files with my application instead of installing complete dot net framework on user machine ?
No it is not possible
The .NET framework is more than just assembly to copy on the target computer. It is a more complex infrastructure that interact with the OS when an executable is loaded and, if it contains IL instruction, it compile it just in time in order to have it running. So non chanches in order to me to have it working without a .NET framework setup, that can be done in a separate step, or by creating a Setup for your app with the proper framework version indicated as a prerequisite.
An overview of the framework can be found here, but many more others are available in the net, you should read it to understand why is not a just matter of functions you need or not.
You may choose to target .NET Framework Client Profile. That would decrease download size of .NET files. See this link for more details on subject: http://msdn.microsoft.com/en-us/library/cc656912.aspx#targeting_the_net_framework_client_profile
No, this is not possible. In order to install and run an application targeting the .NET Framework, the user must have the appropriate version of the .NET Framework installed on his/her computer.
If you want to make things easier, you should distribute your application with a setup program that ensures the .NET Framework is automatically installed along with your app. There's no reason the user should have to download and install the .NET Framework themselves. You can even create a setup program right from Visual Studio, so there's no excuse not to use one. It also makes managing dependencies and versioning conflicts much easier.
If you're really worried about the size of your dependencies and are targeting .NET 4.0, you can require only the Client Profile, which is a subset of the .NET Framework optimized for client applications. You'll have to set your project's Properties to target the .NET 4.0 Client Profile, and ensure that you're not using any of the assemblies it omits.
I hardly recommend wasting too much time on this, though. At last count, the Client Profile was only about 15–16% smaller than the full version—not an amount that makes much difference on the fast Internet connections found in most parts of the world today. And even less of a problem if you distribute on real media.
If you're absolutely dead-set on delivering an application without any dependencies (as comments to other answers suggest), you've got a hard road ahead of you. For starters, you'll need to drop .NET and C# entirely, and switch instead to an unmanaged language like C or C++. That's a very different programming environment than C#. Even if you're the best C# programmer in the world, there's going to be a significant learning curve to pick up C++.
And that still doesn't solve all of your problems. C++ applications compiled using a modern version of Visual Studio will still require that the appropriate version of the C Runtime Library be installed on the user's machine. This is, of course, a much smaller package than the entire .NET Framework, but you can't count on it always being there, so you'll need to install it along with your application.
Moreover, unlike the .NET Framework (which has WinForms, WPF, Silverlight, etc.) there is no GUI library bundled with C++. And if you choose any GUI library other than the native platform API (for example, Qt, which is quite popular for reasons that I still find inexplicable), that gives you an additional dependency. You mention Google's applications a couple of times as a model. Google Chrome targets the Win32 API directly and has written a bunch of their own code to draw their custom GUI on top of that base framework. That's really the only way you're going to eliminate dependencies entirely. And delay your app to market for a significant period of time.

Installation C# application without dot net framework

I have created a new application on C# 2010. After creating a Setup file I came to know that for installation purposes user must have a dot net framework. Is there any way I can get rid of installing dot net framework on a user computer. Each time I try to install my application on the user computer it redirects to install the dot net framework. Any suggestion?
Well that's a problem; because of the design of .NET applications.
Here's some references for you:
Visual C#
"C# (pronounced "C sharp") is a programming language that is designed for building a variety of applications that run on the .NET Framework." [first sentence]
Intro to C# and .NET
As the comments on the question attempt to imply, the .NET Framework is required in order to execute .NET applications.
You have two choices, really:
Require that users have the .NET Framework installed. This is the most common choice, for reasons that will become clear in a moment. It's not unheard-of to have such requirements. It's similar to requiring that a user have Windows installed in order to run your Windows application.
Distribute the .NET Framework with your application installer. This is possible, but less often used because the .NET Framework is large compared to the average application. However, if you must do this, then the option is at least available. Some quick Googling brought me to this helpful blog post.
This isn't possible. C# is built on the .NET framework, so any C# app requires that a version of .NET be available. At http://en.wikipedia.org/wiki/.NET_Framework#History, you can see what .NET framework versions are available in various versions of Windows. The short story is that XP doesn't include anything, Vista includes 3.0, and Windows 7 includes 3.5. If you build for one of these versions, then on those OSes, your users won't need to install anything extra. Using the Client Profile instead of the full .NET can also help reduce or eliminate installs your users will need to do.
Unfortunately No. Its not possible.
To explain it simple terms.
Suppose if you have written only 1 Line of code where you would have simply declared an int variable, who will tell OS that it should create a space in memory?
That framework does exactly that creates basic environment to run your app in a System.
OOPs says about Real-world modeling and Relationships, so let me give you one from it.
Think yourself to be the C# app and Mother Nature/Environment(Greenry) to be .Net Environment.(.Net is called an Environment)
Can you survive without mother nature? From first second that you are in this world, you breathe. Who provides you that oxygen. MOTHER NATURE
While creating installation bundle you can add dot net frame work exe file as prerequisites, then while installing your application it can check whether the system having .net framework or not. if it is not installed it your application can install the frame work.
When you are using managed languages to writing applications you agreed to use their vm, c# codes compiles to IL which needs dot net framework for executing.
.net framework by default exists on windows 7,8,8.1 and 10 and I don't think that this is a challenge.
but if you insist on it so there is a way by using Mono, just remove features that does not support in mono from your project.
first install mono and cygwin, then copy your exe and mono.dll file to a folder, be sure that your file name is not long because in some cases bundling faild,now you can start bundling using mkbundle command.
after bundling finished you have a exe file that can run without .net framework
hope this help you
I have the same issue and want the app to setup using the existing dot net framework version (4.6), because the app setup requires 4.7.2 version that the PC doesn't meet the requirements

Using async-await on .net 4

I'm currently starting to create an application that would profit a lot from C# 5's async-await feature. But I'm not sure which version of VS and of the async runtime to use.
Looking at OS popularity charts, I'll need to support Windows XP for another three years or so. It looks like .net 4.5 runs only on newer versions of Windows, so I need to target .net 4.0. The development machines use Windows 7, so using a newer version of VS is not a problem.
Now I need to first choose a compiler for doing this:
VS2010 with AsyncCTP
VS2012 Preview (and final once it arrives), setting the target to .net 4.0
Mono (Looks like 2.12 has async-await, I prefer/am used to VS over MonoDevelop as IDE)
Which one has fewer code-gen bugs? Looking at Jon Skeet's blog the VS2012 Preview uses a never code-generator than the CTP.
And more importantly which runtime to use?
Does VS2012 contain a redistributable async runtime for use with .net 4?
I managed to compile code, with the preview, by referencing the AsyncCTP runtime. But since the CTP has strange licensing conditions, that doesn't look like a good long term solution.
Or should I use a third party implementation? Perhaps mono has one?
For distributing the library I prefer simply putting the dll in the same directory as the application, instead of some kind of installer.
I'd also like it if my binaries would work without changes on mono+Linux/MacOS. So the runtime should either be compatible with whatever mono (2.12 probably) has built in, or allow use on non windows OSs.
Microsoft released the Async Targeting Pack (Microsoft.Bcl.Async) through Nuget as a replacement for the AsyncCTP.
You can read more about it here: http://blogs.msdn.com/b/bclteam/archive/2013/04/17/microsoft-bcl-async-is-now-stable.aspx.
You can read about the previous version here: http://blogs.msdn.com/b/lucian/archive/2012/04/24/async-targeting-pack.aspx.
As this pack is officially supported, I now believe the best option for targeting XP + async would be using Visual Studio 2012 + C#5 + Async Targeting Pack.
If you feel the need to target .NET 3.5 though, you can still use (my) AsyncBridge for .NET 3.5.
If you are open to considering other .Net languages, F# can solve your problem. It has had the async{} computation expression for years, and is backwards compatible even with .Net 2.0. Minimum requirement is Windows XP SP3. The runtime can be downloaded here.
It's possible to use the VS 12 beta to target .NET 4.0 using async/await.
You need to copy some code into your project that provides the types that the compiler relies on.
Details here
Edit: we've taken this technique and turned it into a open source library called AsyncBridge:
https://nuget.org/packages/AsyncBridge
If you want to be able to distribute your software, I think that the Mono solution is really your only option right now. You also say that you want the end result to run on Mono over Linux and OS X. Targeting Mono to begin with seems like the natural solution.
Your next issue is the IDE. MonoDevelop would obviously work well but you say you prefer Visual Studio.
Greg Hurlman created a profile to code against Mono 2.8 from Visual Studio. If you follow-up with him, he might be able to point you in the right direction for developing against Mono 2.11/2.12 in Visual Studio.
Of course, there is also Mono Tools for Visual Studio which is a commercial product. I assume that it is still being offered by Xamarin.
You might also be able to run the required 4.5 profile assemblies from Mono on top of .NET but I have not tried that. The 4.5 profile is a strict super-set of the 4.0 API. Perhaps give it a shot and report back.
EDIT: It looks like perhaps you can use the Visual Studio Async CTP in production now
Here is what it says on the download page:
Includes a new EULA for production use. Note - This license does not
constitute encouragement for you to use the CTP for your production
code. The CTP remains an unsupported and use-at-your-own-risk
Technology Preview. However, we’ve received many requests from
developers to use the CTP for production code, and so have changed the
license to allow that.
If you want to start distributing your software after MS releases C# 5.0, then you can start developing using AsycnCTP.
Otherwise I wouldn't recommend you to use it, as it is just CTP, not even a beta. It can be changed a lot close to the beta stage and to the release. It may be unstable, etc.
If you want to introduce easy async operations in your application I would recommend you to use Reactive Extensions and stuff built on top (Reactive UI, etc), it is just beautiul.
As for VS2012, it also contains the same Async CTP as far as I remember from my //Build/ tablet MS gave me on that conference.

Which versions of .NET Framework I can count on?

I am writing an app to discover what features exist on a pc. The user would go to a web page, download the app and execute it (with all the appropriate warnings, this is not spyware). The app would use the standard MS api to determine such things as connection speed, installed memory, firewall health, etc. Writing the app is not a problem, I could use Scripting Host, C#, C++, etc. The question is, if I chose C# is there any guarantee that a certain flavor of windows would have .net installed? The target pc is XP SP2 or better and Vista.
Thanks for the help.
Vista does have .NET 3.0 installed. XP SP2 doesn't have any .NET framework installed by default.
You may want to read Scott Hanselman's blog post SmallestDotNet: On the Size of the .NET Framework, specifically the What's the "Client Profile?" section:
The Client Profile is an even smaller
install option for .NET 3.5 SP1 on XP.
It's small 277k bootstrapper. When
it's run on a Windows XP SP2 machines
with no .NET Framework installed, it
will download a 28 meg payload and
give you a client-specific subset of
.NET 3.5. If the Client Profile
bootstrapper is run on a machine with
any version of .NET on it, it'll act
the same as the 3.5 SP1 web installer
and detect what it needs to download,
then go get it. There's more details
in the Client Profile Deployment Guide.
Mehrdad has it right, SP2 has no .NET installation by default. It's worth noting, however, that you can provide a download for users who lack the runtimes, providing whatever version you are using bundled in. It's an option through the creation wizard of one of the setup packages.
Like the above have stated, .NET is not installed by default. However if you were using ASP .NET with C#, many things could be gotten just by viewing the website (computer name, domain, userid, etc).
Well if you are afraid of use .Net but the client does not have installed, you could try a product which takes all your .Net dependencies and creates an isolated installer that will run on every computer, with all the risks that this could raise to your users (no updates, no bug fixes and such).
Here is the link:
http://www.remotesoft.com/linker/index.html
Hope this helps.
I would suggest avoiding .NET if possible since most versions of Windows come without it and the installer will just add to the pain of using your program. Unless its a large application already... but from the sound of it you can get what you want with a few KB's of C++ executable (i.e. almost instant download).
Pre-Vista: there is a significant chance that .NET will not be installed. And event if it is it may be 1.0 or 1.1.
Vista includes .NET 3.0 in RTM, but it is an optional component in Server 2008.
I would also be considered about the size and start up time of .NET. Overall this sounds like something to be written with as few dependencies as possible.
EDIT: Corrected Vista included 3.0 not 3.5.

Categories

Resources