Building .NET 4.0 project on Windows server 2016, Window 10 - c#

We recently need to upgrade our build server from Windows server 2008 to 2016. Because 08 is fading out
As we all know, Windows Server 2016 is installed with .NET Framework 4.6 and from https://learn.microsoft.com/en-us/dotnet/framework/install/on-windows-10
You can only have one version of the .NET Framework 4.x installed on your machine.
You cannot install an earlier version of the .NET Framework on your machine if a later version is already installed.
The case is, we have many projects using
.NET 4.0 with EF 4.4.0.0
.NET 4.5 with EF 5.0.0.0
And some classes such as System.ComponentModel.DataAnnotations.Schema.ColumnAttribute had moved from EF to .NET from EF 4.4.0.0 to .NET 4.5 along the upgrade.
Therefore, missing .NET 4.0 results in:
error CS0433: The type
'System.ComponentModel.DataAnnotations.Schema.ColumnAttribute' exists
in both ...\workspace\....\EntityFramework.dll and
...\Windows\Microsoft.NET\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll'
because it trys to use .NET 4.5 with EF 4.4.0.0.
My question is: we don't have resources to ask QA teams to have a full test on every aspects of our applications, but we do need to use the new build server. Do you guys have any other idea / thought thats worth trying so that the it can build?

Related

WinForm application upgraded to .NET Framework 4 still requires .NET framework 1.1 to be installed on client machine

We have one legacy .net winform application which we have updated to .net framework 4.0. And now i can see that all assemblies with latest version. But somehow to run this application in production environment requires .NET framework 1.1 to be installed on client machine.
Also checked all referenced assemblies using ILDASM tool and those are also not using any .NET 1.0 assembly file.
So Is there any way to check why this application still requires .NET Framework 1.1 to be installed?

Build .NET 2.0 project with 4.0 dependencies

In order to create a C# CLR function, I need to create an assembly of my dll on a SQL Server 2008 SP3 machine. I have to build my project targeting .NET 2.0 as it appears that SQL Server 2008 only works with version 2.0. The problem is that my project has references to the other projects in the same solution which are all in version 4.0 and I cannot change them.
I did some searching online and it seems like you could create an application that targets the .NET Framework 4 referencing assemblies that targets .NET Framework 2.0 but not the other way around. (http://msdn.microsoft.com/en-us/library/ez524kew.aspx)
Is there a workaround of this? Any suggestions would be appreciated. Thanks.

Application requires version 4.0 full or other compatible .Net framework

I am getting error Application requires version 4.0 full or other compatible .Net framework
I have the below mentioned prerequisite-
Windows Installer 4.5
Microsoft .NET Framework 4 Client Profile (x86 and x64)
SQL Server Compact 3.5 SP2
SQL Server 2008 Express
Windows Installer 3.1
Please let me know why is throwing such error when i have mentioned Microsoft .NET Framework 4 Client Profile (x86 and x64).
It appears that you need Microsoft .NET Framework 4 Full version, not just the client profile. Installing Microsoft .NET Framework 4.5 should also satisfy this requirement.

New Version Error C#

I've built a windows service code with Framework Verison 4.0, when I sent my service.exe for instllation at different machine which has version 2.0 installed it gave error:
"Exception occurred while initializing installation:
System.BadImageFormatException: couls not load file or assembly '\service.exe' or one of its
dependencies. This assembly is built by a runtime newer than currently loaded runtime and cannot be loaded"
How can I build a service which is backward compatible in visual studio
Change your target framework to 2.0, and make sure you do not use anything that's not part of 2.0 (e.g. TPL, etc), otherwise, install .NET 4 on the target machines
You cannot run .NET v4.0 code in .NET v2.0 runtime. Either install .NET v4.0 on the server or convert your servive to .NET v2.0
When you have a .net framework 4.0 installed then you can run any application which has a target framework value as 2.0 , 3.0 , 3.5 and 4.0
and when you have a .net framework 3.5 installed then you can run any application which has target framework value as 2.0 , 3.0 and 3.5 , like this it goes on.
This is mandatory requirement for .net framework , so it would be better if you ask your client to install .net framework 4.0 or create a service (i hope this is windows service and not wcf service because wcf is supported only from framework version 3.0) project which targets the framework version 2.0.

Changing framework from 3.5 to 4.0 at Server

I know my Question is little bit basic but have to ask about this:
i have my website build in Visual Studio 2008 with .Net framework 3.5
that site is hosted on my server.
now because of some specific reason i have to install framework 4.0 to the server.
and i just want to know that my site will be okk with it or not.
I mean if i change my framework from 3.5 to 4.0 then is there some changes i should make to my site or that site will run fine as before.
You should also change Framework Version in the application pool of your WebSite.
Basically, remember that Framework version != CLR Version.
In your case, .NET Framework 3.5 = CLR 2.0 + (C# 3.0 | VB9)
.NET Framework 3.5 and 4.0 have different CLR Versions and can be installed side by side on same machine.
That means your site will not see any issues.
There is no problem installing the framework 4 on the server.
Your site should be fine as long as you don't change the target framework on the IIS appPool.
You can have all the frameworks installed on the same machine.

Categories

Resources