So I've made a back-end project in .NET 5.
I'm trying now to make a release pipeline in Azure Devops, where my code is also located.
Errors include:
Error : Version 5.0.100 of the .NET Core SDK requires at least version 16.8.0 of MSBuild. The current available version of MSBuild is 15.9.21.664. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
Error MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1179,5): Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v5.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
In the above picture's the steps I take:
First I use the almost latest version of Nuget, 5.8.0
Then the next job is a "nuget restore".
The next step is to specifically specify it needs to use .NET 5 SDK (if this job isn't included, Azure Devops throws errors on this, stating that it can't find runtime=net50 etc...).
Here's the more in detail screen:
The next job is the "MSBuild" one, here in more detail:
This "MSBuild" job replaced my "Visual Studio Build" job, because here I could set it to version "16.0" but apparently this doesn't work? The regular "Visual Studio Build" details look just the same, even in my settings, but doesn't include the "MSBuild version" option. Using the regular "Visual Studio Build" option didn't work (see above errors as well).
The next jobs he doesn't even reach yet, so I'll presume for now they work correctly. The issue is indeed with the builds, using SDK, restore etc...
Does anyone who has more experience making azure pipelines/builds in .NET Framework 5.0 or higher have an idea what's wrong here and how I can fix this? Or even an idea where I should look?
I've been breaking my head over this the entire day and it's about to explode...
You should use a different type of tasks to restore/build etc .net core apps
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops&tabs=dotnetfive
I want to debug an empty WebApi Project based on .NET Core 2.2.
I installed the "Core 2.2 SDK x86" and changed the target framework to 2.2:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
When I started to debug this project, IIS starts, but in the route api/values I see nothing (it loads forever) and I get this error:
The target process exited without raising a CoreCLR started event.Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core
In my solution WPF and Class Library projects exist. I wanted to make a WebApi for it. Like I said, it's an empty base project generated by Visual Studio 2019. I just installed Core 2.2. Why do I get that error and what am I doing wrong?
I had the same issue.
I ran Program.cs file from the command line and the error message was different.
So, apparently, I didn't have the appropriate .NET Core runtime installed.
You can download it by the following link - https://dotnet.microsoft.com/download
I was facing the same issue!
I updated my Visual Studios to the most recent via the VS Installer.
While updating, I also added the following VS Workloads:
ASP.NET and web development
.NET desktop development
See about workloads here:
https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/install/modify-visual-studio.md
This worked for me! 😊
I did not have to downgrade or remove anything
I had to do a "clean" and "rebuild" of the project and after that it worked again.
I ran with the same problem. But for me it was that my project was running in .NET Core 2.2, which I didn't have installed. I'm using VS 2019.
So for the solution, just go to Visual Studio Installer and for your VS 2019 hit "Modify" like in the following image (it's in spanish though):
Then, click "Individual Components", like
And then, make sure you checked in ".NET Core 2.2 Runtime (EOL)" (and above like .NET Core 3.0, if you want) and click "Modify", as shown
Hope this works for you.
In my case, switching to x64 save the day.
It seems like there are lots of different causes for this. For me, it was because I had upgraded a .csproj file but I hadn't updated the image used in my docker file.
I had same issue after package upgrading. You don't need any vs update.
Just go to
dotnet.microsoft.com/download/dotnet-core/2.2
and get runtime
dotnet-hosting-2.2.7-win.
I had the same error. Remove "Microsoft.AspNetCore.All" from dependencies.
I have downgraded "Microsoft.AspNetCore.App" version and error gone .
Deleting all bin folders of my solution
building everything again did the trick for me
(.NET Core 3.1 VS 2019)
I see many answers like try and error
after searching about the issue, I got the following :
it simply depends on three parameters and they have to be compatible
Windows platform "x86,x64" you can change it from the CPU option of the visual studio
or choose any CPU hence the install .net x framework should be compatible with the windows
The target framework for the project
(check the project target framework "right-click on the project and check target framework") if it is 5 so the enabled in the third parameter should be 5 or change this one but take care you should tell the other team members if you change it
The Enabled framework go for tools and get tools and go for individuals component and chose the target framework the same as found in step 2 and press modify
Faced this issue during xUnit testing. Downgrading nuget package "Microsoft.NET.Test.Sdk" to 15.9.0 worked for me
I got this error because of a Project reference pointing to a project, that did not exist anymore (was removed in merged git-commit). Solved it by right-clicking the project, then Edit Project File, delete the reference and save.
I was trying to run a project that used net core 2.2 but I didn't have it, and there was no error(I had 1.1), so after installing the 2.2 using the "Visual Studio Installer" it worked like a charm. =)
I restarted my Visual Studio instance in Admin mode and I was able to debug.
After closing Visual Studio I can now start in normal mode and debug as expected. I'm not sure what changed though.
I was missing a reference to AWSSDK.Core. After installing the specific version and re-starting VS2019 and rebuilding, the project ran fine.
All of a sudden it stopped working. For me clean solution and re-build solution worked.
I was getting a similar error with my project: The target process exited without raising a CoreCLR started event.
My startup project was targeting multiple frameworks: netstandard2.0;netcoreapp2.2
I fixed this issue by changing my target framework from netstandard2.0 to netcoreapp2.2 using the following stackoverflow directions: How to switch between target frameworks for .NET Core projects in Visual Studio
Be sure to install the exact version of .net core that you want your project to run on
I had this issue and finally tracked it down to doing a "publish" operation with a deployment mode of: "Self contained" That resulted in dropping all .NET runtime binaries in my bin directory. Where I think things got totally messed up is I have several solutions all using that same common bin directory, each build different exe's and dll's.
Only one was for a self contained deployment as a test. I think that started mixing up some of the minor dlls for the .NET core and causing this issue. Once I purged all the dll's that were "not mine" and rebuilt things started working again. I'm using Visual Studio 2019 16.8.2 / .NET Core 3.1
I realize the original question is regarding .NET Core 2.2 but this question comes up first when searching for the main issue.
.Net Core 2.2 is required to be installed. I fixed when I added this in Visual Studio Installer.
VS2019 16.7.1 ASP.Net Core 3.1
Our Nunit test projects that issued this error, only worked with a very select set of Nunit and Microsoft packages.
Microsoft.NET.Test.sdk - 16.5
Nunit - 3.12
Nunit3TestAdapter 3.16.1
But here's the catch, you have to go into
c:\users\yourname\.nuget\packages and look for all three folders shown above. If you find any other version in those folders, delete it.
I found two versions in the Microsoft.NET.Test.SDK folder. I suspect the newer version was being loaded. Why? Because when I deleted it everything ran fine.
A corrupt layout is also possible, had this happen myself. To fix, go to projpath\bin\x64\configtype\AppX, for example:
C:\Users\Foo\Documents\Visual Studio 2019\projectname\bin\x64\Debug\AppX
Delete everything here, rebuild and you're good to go.
Since I don't see it here yet, here's what worked for me. I have a UWP project, Win32 project, and Windows application packaging project in the same solution. Running the Win32 app using FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync was giving this message and not working.
What fixed it was changing a setting in the packaging project's project settings:
Debug -> Debugger type -> Background task process: Native Only
I had same issue. Now in VS2022 you cannot download NetCore2.2.
So just download and install NetCore 2.2 from microsoft dotnet website.
https://dotnet.microsoft.com/en-us/download/dotnet/2.2
This error occurred when I tried changing C# projects in my solution to use Docker and running it:
The error went away when I changed the C# projects back to use the Visual Studio's debug server and running it:
In the Test Explorer window of Visual Studio 2019, make sure that there are no references to any *.testsettings or *.runsettings files if you are not using them intentionally. I had referenced a *.testsettings file unintentionally, and that was causing the issue.
For me, I'd just installed Visual Studio 2022 on a fresh installation of Windows 11. My project uses .Net 5, which wasn't installed by default (I only had .Net 6). I simply used the Visual Studio installer, modified my VS2022, selected Individual Components, and enabled .Net 5. Viola!
I started to get this error after updating Visual Studio from 2019 to 2022. It turned out that the project target framework was set to .Net Core 3.1, which was removed when I uninstalled VS2019, and the solution was to change it to .Net 6.0 which is the component I had selected during installation (Installing .Net Core 3.1 from the Visual Studio Installer should work as well).
To do so, right click on the project name and look for the "Target framework" option (my installation is in Spanish so that's what I presume it should say).
I've encountered this issue multiple times, using VS 2017 and VS 2019 across .NET Core 2.1, 3.1 and 5.0.
There are many conditions that can cause this problem to occur:
Microsoft Update can install a version of .Net Core at any time, automatically and outside of your awareness and knowledge.
It can also change the installation of any .Net Core SDK version's installed components.
Your version of VS has to be compatible with the version of the .Net Core SDK that you have installed.
You must have all of the following components installed for this error to be resolved/pre-empted for .NET 5.0 (please check the dotnet 5.0 site for the compatibility list by versions).
Microsoft .NET SDK 5.0.408 which includes (the following below) must all be installed and listed in the control panel:
.NET Core 5.0.17 Windows Desktop Runtime,.NET Runtime, Windows Server Hosting, Shared Framework
If any .NET Core 3.1 SDK are installed without your knowledge, you must uninstall it and repair your targeted .net core version's installation.
I got the below error while building the Enterprise Bot Template Project in VS2017. Not sure what i 'm doing wrong here.
Severity Code Description Project File Line Suppression State
Error CS1703 Multiple assemblies with equivalent identity have been imported: 'C:\Users\XXX.nuget\packages\microsoft.netcore.app\2.1.0\ref\netcoreapp2.1\System.Runtime.Serialization.Json.dll' and 'C:\Users\XXX.nuget\packages\system.runtime.serialization.json\4.3.0\ref\netstandard1.0\System.Runtime.Serialization.Json.dll'. Remove one of the duplicate references. SovereignBot C:\Users\XXX\Documents\Visual Studio 2017\Projects\SovereignBot\SovereignBot\CSC 1 Active
Any ideas how to fix?
I'm not able to replicate this issue with a fresh install of the Enterprise VSIX template. This leads me to believe the issue is either in your code or on your machine.
After researching, it appears there could be a couple of problems and solutions:
Your Local/Development and Build servers use different versions of Visual Studio
Update Visual Studio for both environments
If you're still experiencing issues, try installing the Microsoft.CodeDom.Providers.DotNetcompilerPlatform NuGet package.
NuGet or .NET Core is out of date
Update NuGet
Update the appropriate .NET Core SDK. Currently, Bot Framework is supported well on .NET Core 2.2. Keep in mind that if you have 2.2 installed, you may need to update to the latest sub-version (v2.2.104, as of now). Keep in mind you may also need to upgrade your NuGet packages within the project in order to be compatible to the .NET Core SDK.
Ensure your bot is using the correct .NET Core Target Framework by right-clicking the Project > Properties > Application:
Your Visual Studio version doesn't handle dependency version collisions on its own
Update your Visual Studio
You have a duplicate reference to the same package (but possibly different versions) in your .csproj file
This is more likely if you're using code brought in from another project.
Delete or comment out the duplicate by right-clicking on your Project in Visual Studio, and clicking Edit .csproj:
You have a package installed via both NuGet and locally
(I don't believe this is the issue for you, since both of your packages appear to be in the NuGet directory)
Go to the file path of one of the dependencies and delete it.
I'm running into an error which seems to be a combination of three factors, and I'm trying to find out if this is a known issue, and if there is a fix or work-around for it.
Factor 1: We are using Visual Studio 2015, update 3.
Factor 2: We are using .net 4.6.2. This version of .net is not included in VS2015, so it was added via the Developer Pack link, located here: https://www.microsoft.com/net/download/windows
Factor 3: We are using Microsoft.Extensions.Dependency Injection. Version 1.0.0, but the issue is reproducible in every version except 2.0.0, which does not appear to be compatible with .net 4.6.2
In order to most easily reproduce this, I am able to create a new solution in Visual Studio 2015, with a new empty web application project, targeting 4.6.2. I open the Nuget package manager, find Microsoft.Extensions.DependencyInjection, and include version 1.0.0 in my project. Build the project, and get this error:
Error CS1703 Multiple assemblies with equivalent identity have been imported: 'c:\Projects\DITest\packages\System.Runtime.Extensions.4.1.0\lib\net462\System.Runtime.Extensions.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Runtime.Extensions.dll'. Remove one of the duplicate references.
Does anyone have any idea why this might be happening? If I build targeting 4.6.1 it works fine, but we have other dependencies which necessitate 4.6.2. I do not currently have access to Visual Studio 2017, but if it turns out that necessary to make this code run properly, I can pursue it.
Every avenue I've explored regarding this has ended up in a dead-end.
I have a c# solution that accesses a c++ project through COM. The project has to be targeted to a specific processor, in this case x64. I am using the Windows installer to install the application.
The first problem I ran into was the c++ dll was not being registered properly when installed, and the program couldn't access it. I solved this by adding the c++ project to the solution.
For a while this worked, and everything installed properly, but then I started getting the following warning when I tried to build:
The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework 3.5'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#).
The setup would not install if I tried ignoring the warning. After some searching, I found that the c++ project was building in .NET 4.0, while my solution used .NET 3.5. I tried changing my solution to 4.0, but for some reason it stopped working, so I changed the c++ to 3.5.
This worked for a couple of builds, but then I began getting the following errors:
Error: LNK1104 cannot open file 'mfc90.dll'.
I added the file to the Additional Dependencies section, but then another link error occured (mfcs90.dll) and when adding that one, I got an x86 x64 conflict.
I'm not sure why these solutions worked for a while and then stopped, and I can't seem to find a resolution at any step that works. If anyone has seen anything similar to this, the insight would be appreciated.
In order to include the Microsoft runtime dlls, you should not simply include the dll in your application directory. This won't help when the dlls have various dependencies and you might run into different conflicts and versioning issues.
The way I would recommend installing the runtime dlls for you application is to include the official merge module in your MSI.
See the following link for your options to redistribute the runtime library:
http://msdn.microsoft.com/en-us/library/ms235316(v=vs.90).aspx