VS 2010 Setup Project Requires .NET 4.0, but it is already installed - visual-studio-2010

I have a VS 10 project using .Net 4.0 and I use lots of stuff that do require 4.0. I created a VS Setup project added the primary output from my project and built it. I then installed it and everything worked fine. A few days later I am ready to do a new build so I rebuild my project and then the setup project. Now when I run the msi it tells me that .Net Framework 4.0 is required.... I figured I screwed it up so I just create a new setup project, and that works fine. But again a few days later (restarted VS in there probably and maybe even the computer) I rebuild and get the error telling me that .Net 4.0 is required. I did it a few times just to verify and it consistently happens and I cannot figure out why.
The project I am building and installing has a windows service that is set as the startup project. I will switch that to a console app object for local testing purposes and build and test the project (not the setup project). This is the only thing I can think of that may be impacting the build, but again, I cannot figure out why.
Any help is appreciated.

This error message is thrown when the Launch Conditions in the Setup Project aren't met.
Go to View > Editor > Launch Conditions
Change the .Net Framework version value to
match the version your setup project
is compiled into. By default, the 2010 setup and deployment project condition is set to .NET 4.0 Client Profile.

Related

Difference between building/running a .Net Core app using Visual Studio and CLI/VS Code

I'm trying to figure out the differences between running/building a .Net core project using Visual Studio and the CLI, i.e. what process does Visual Studio follow when running the project?
I spent half a day yesterday debugging an issue where a static web resource could not be found (404) when I ran the project (both F5 and Ctrl+F5) using Visual Studio - both Debug and Release configs using both IIS Express and Project launch options - only to discover that the problem does not occur when I run the exact same project using VS Code's debugger (F5 or Ctrl+F5) or the CLI (dotnet run) directly. And today I wasted yet another 3 hours when I received a new build error message when building using VS, but the same project built and ran 100% using the CLI and VS Code...
I have a clean development environment with only one SDK that was installed along with VS, so they are both using the same SDK.
Given, I am playing around with .net5.0, so I'm using the latest preview build of VS (Version 16.8.0 Preview 2.0), but as far as I'm concerned, there should not be ANY differences when running a project using VS and the CLI. Unfortunately I cannot replicate the same issue using the stable build since both the problems are related to .net5.0 features (Scoped Styles and Blazor WASM).
Could someone please enlighten me on the steps that VS takes when running a .Net Core Web project? I KNOW it is not simpy using dotnet run as one would expect, so I would like to get as much info before I log yet another tooling issue with the dotnet people...
Any reply would be appreciated.

TeamCity Warning: No enabled compatible agents for this build configurationn

I'm trying to set up continuous integration at my current place of work. It's not something I've done before so I'm fairly certain that there will be a few steps I've not done or things I'm un-aware of.
I installed TeamCity Professional 7.1.3 on a build server (Windows Server 2008 R2). I've created a simple .NET application that has no database connections and only three NUnit tests. This app uses .NET framework 4.
I set up a build step using NUnit and received a number of errors but I've now resolved them, basically by installing the .NET framework on the build server.
I'm now adding an extra step using Visual Studio but TeamCity now displays the warning 'No enabled compatible agents for this build configuration'.
This question looks similar to mine:
What do I need to install a Visual Studio 2010 (sln)-compatible Build Agent in TeamCity? and it helped me solve the problems I had with NUnit but not for this current problem.
Is there something I've missed during my set-up? If I'm building and running tests with NUnit do I need to bother with this second step?
You installed the full framework, correct -- not just the client pieces? Here's a TeamCity forum post on how to resolve the Unmet requirements:DotNetFramework4.0_x86 exists compatibility error when you've previously installed the framework.

How MSBuild multitargeting works

I will try to explain this as clear as I can
I want to fully understand how MSBuild multitargeting works.
I have read several articles from Microsoft and I think I understand the basic but I want to be sure I am not missing anything.
According to Microsoft:
By using Visual Studio, you can compile an application to run on any one of several versions of the .NET Framework. For example, you can compile an application to run on the .NET Framework version 2.0, and compile the same application to run on the .NET Framework version 4. The ability to compile to more than one framework is named multitargeting.
Visual Studio runs under the most current version of the .NET Framework that is installed on the development computer.
http://msdn.microsoft.com/en-us/library/ee395432.aspx
So do this mean that Visual Studio always calls MSBuild from the latest framework installed? assuming Visual Studio 2010 is installed, it will always call: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe when building any project targettting any .Net Framework version right???
If yes, then the ability to target old .Net Framewrok versions is based on the ToolsVersion and/or TargetFrameworkVersion properties right???
If yes again, it would mean that just installing the latest framework (and also the older frameworks but not installing visual studio) in my Continuous Integration box, I could point to build always any solution to: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe and just specify the ToolsVersion argument (if required, since each project can have its own target version specified in the TargetFrameworkVersion which it would cause to target an older .Net Framework version).
Following this I think my CI box would be building like Visual Studio does. Am I right? What am I missing? Is there a way to be completely sure?
I did a quick test, and I think it works :p the projects are being built according to the .Net Framework specified but like I said I want to be sure I am not missing anything.
Any thoughts?
BTW:
The simple reason to want to do that is because I have several custom MSBuild scripts that are reusable accross projects, but some of the functionality in these scripts require MSBuild 4.0 and also I have several MSBuild tasks built on top of the framework 4.0 so if I have for example a solution targetting the Framework 2.0 and I try to build it using: %WINDIR%\Microsoft.NET\Framework\v2.0.50727\MsBuild.exe I get MSBuild errors trying to load my custom targets
Yes, you've got it mostly correct. Calling MSBuild from the 4.0 directory will do the correct thing against previous versions. They only thing I wanted to add was that 3.5 must be on the box to actually build projects targeting 2.0, 3.0 and 3.5.
This page here: http://msdn.microsoft.com/en-us/library/bb822049.aspx calls out the what versions Windows comes with what version of the framework pre-installed.

Why does Windows application is requiring .Net 3.5 framework

I have the Target Framework set to 2.0 on my windows application, yet when I try to install my app on the server, after publishing it through VS 2008, it is trying to install .Net 3.5 on the server.
I do not want to install 3.5 on my server.
When I copy the files from my local /bin/debug/ to the server and double click on the exe, nothing happens. On my local machine, my app runs.
How can I make this app run on the server without it needing the .Net 3.5 framework?
Do any of your dependencies require .NET 3.5? Do you have anything in any config files which might require .NET 3.5?
I suggest you take a copy of what you've got for safekeeping, and then cut it down to the very smallest app which demonstrates the problem. In fact, you might want to start from scratch with a "no-op" app and see whether that has the same behaviour.
Check unused references, perhaps? Are you actually getting an error about the 3.5 framework?
Try building the application in release mode and deploy it to the server. You will need to grab the application from the /bin/release folder instead of the /bin/debug folder.
Also, check the target framework under the application section of the project properties.
If you're using Visual Studio to build your setup project, open the setup project's properties and look through the settings. One setting says which .Net version will be demanded by the installer package. You have to set that; it doesn't inherit from known properties of your other projects.

.Net Framework 3.5 is needed for installing my VB 2008 Project?

Using VS 2008
I created a setup file for my Project, I run the setup file in my system, and My Project is working fine.
If I install my project to another system, is asking .Net Framework 3.5 at the setup time.
.Net Framework 3.5 is needed for installing my Project?
Before i installing my project, i install the .net framework 3.5, It taking to much time to setup?
How to solve this? or any other way to create a Project setup ?
Can any one help to solve my setup problem.
What you need to do is right click on the setup project in the SolutionExplorer and select the Properties menu option. You can then click on the Prerequisites button. This allows you to control what your setup program needs/wants in order to install your code.
If you don't need .NET 3.5 then just unselect it. This is just one more annoying thing that VS2008 does, you select .NET 2.0 as your target framework but it leaves .NET 3.5 as a pre-req.
If it is important for you that your program does ot require .NET 3.5, you can set up your project to target .NET 2.0. The the setup project will also see this, and (hopefully) remove the dependency when you update it.
If your project is VB.NET, you can set the Target Framework version here:
Project Properties -> Compile -> Advanced Compile Options...
If Your project is C#, it is here:
Project Properties -> Application
If you do this, of course you will not have available any .NET 3 specific functionality.
Do you rely on .net 35 features in your code. If not you can recompile with the project settings targetting .net 3.0 or 2.0.
The .NET 3.5 framework has two different installers to choose from: the bootstrapper and the full package.
The bootstrapper installer is small in size (2.7 MB). It's small because it downloads the required files from the internet when executed on the target machine. Depending upon the target's network bandwidth, it may take a long time to run.
The full package installer is large (237 MB), and does not require an internet connection to run.
If you are currently using the bootstrapper installer, you should try downloading the full package installer and running that on the target machines.
(That is, if you actually need .NET 3.5)
You can select either installer from here.

Resources