The specified Microsoft.NETCore.App', version '2.0.7' was not found - visual-studio-2017

cannot start .NET Core app because of this error:
"It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.7' was not found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '2.0.7'.
The program '[1560] dotnet.exe' has exited with code -2147450749 (0x80008083)."
Editing .csproj didn't help. It looks like this:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.7</RuntimeFrameworkVersion>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

You don't have the right .NET Core runtime installed. It's not good enough that's a .NET Core 2 runtime; it needs to be a minor version that is equal to or encompasses the version you're trying to target. You can see all the available runtimes here: https://www.microsoft.com/net/download/all. Specifically, you need 2.0 Runtime (v2.0.7) or higher. You can just choose 2.1, though. 2.0.7 will be rolled in and then, if you do end up upgrading your project later, you won't run into this issue again.

After playing around for a (longer) while, eventually it turned out that the solution is to comment out RuntimeFrameworkVersion in .csproj:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<!--<RuntimeFrameworkVersion>2.0.7</RuntimeFrameworkVersion>-->
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
It is worth mentioning that the problem occured after my collegues upgraded a .NET Core to higher version and I did 'Get latest version'.

Related

Getting Error When Switching to Platforms Other Than "Windows, Mac, Linux"

I'm using unity-sdk version 6.0.0 in Unity 2021.3.9f1. When I switch to any Platform other than "Windows, Mac, Linux" I get the following error in the console:
Assets\IBMSdkCore\Connection\RESTConnector.cs(668,24): error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
Switching back to "Windows, Mac, Linux" clears the error. I have ensured that when viewing Assets/Watson/WatsonUnitySDK in the inspector that under Platforms only "Any Platform" is checked and that nothing is checked under "Exclude Platforms".
Any assistance would be greatly appreciated, thanks in advance.
The answer is in the "Configuring Unity" section of the unity-sdk GitHub repository:
"If using Unity 2018.2 or later you'll need to set Scripting Runtime Version and Api Compatibility Level in Build Settings to .NET 4.x equivalent. We need to access security options to enable TLS 1.2."
The setting is now labeled ".NET Framework", but switching to it from ".NET Standard 2.1" resolved the error.
I'm almost certain I remember setting the .NET version per the instructions when I originally set up the project, but I may be mistaken. Anyway it's fixed now.
EDIT: I had set the compatibility to .NET Framework. I just discovered that every time you change the build platform Unity reverts to 2.1 and you have to manually go switch to .NET Framework again.

application failed to find Chromium-edge browser

I created a sample application to open a webpage on microsoft edge, by following below URL guidance.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/win32
I installed packages using NuGet packet manager as instructed. Everything worked fine on development machine.
Then I copied the exe of my sample application and the library "WebView2Loader.dll" into testing machine, which has Microsoft edge Version 83.0.478.50 (Official build) (64-bit). I got "ERROR_FILE_NOT_FOUND" error, means "Either it failed find the edge installation or version is Not compatible with SDK version". This error is on call CreateCoreWebView2Environment(), which supposed to find browser.
I am trying to find out why it is not working when it has higher version of than minimum required version. As per documentation, minimum required version of edge is 82 I have 83.0.478.50.
Let me know what I am missing on test environment? should I set any environment variables? I tried find online if there any environment variables required, couldn't find any.
Edit:
The current version Microsoft.web.webview2 SDK is 0.9.488. The testing box has edge version 83.0.478.50. I understand that I need to update my edge version on Testing machine.
What version of the SDK package are you using?
The way to find out the minimum version of the browser for a given SDK package is to look at the build numbers. For example:
SDK version 0.9.538 requires Edge n.n.538.n+
More details can be found here:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/versioning
CreateCoreWebView2Environment or CreateCoreWebView2EnvironmentWithOptions returns 'FILE_NOT_FIND'?
You need webview2 runtime. You should download WebView2 Runtime installer (Preview) and then run it.
Separate webview2 runtime is not necessary if there is a fully functional Microsoft edge(Chromium). But the stable channel Microsoft edge(Chromium) is not supported by now, as the webview2 is in its preview stage.

Download prior version of Specflow .vsix

Our team supports the automation efforts of users who are on the latest version of Specflow, as well as those who are not. So the need exists to bounce between the current .vsix for Specflow on VS2017, as well as the .vsix that expects Specflow 2.1 (right now I'm stuck because any feature.cs regeneration fails with a can't find 2.2). I did attempt pulling from https://github.com/techtalk/SpecFlow.VisualStudio/tree/release/v2017.1, but am getting several unresolved references to Microsoft.VisualStudio.
Any way to simply pull the .vsix that works with SpecFlow 2.1?
Edit: Thanks Andreas, the fast response is much appreciated. I will go ahead and open an issue on GitHub if you wish, but I didn't mean to imply that there is an issue with the extension. It may well be a misunderstanding on my part - I though that the current Specflow VS Extension 'expects' SpecFlow 2.2.
As you know, SpecFlow 2.2 uses NUnit 3.x, whereas SpecFlow 2.1 uses NUnit 2.x, which is essentially a breaking change for solutions that used obsoleted features of NUnit 2.x.
So when I switch from a branch that used SpecFlow 2.2 to another branch that uses 2.1 (even tried clearing AppData/Local/Temp), the SpecFlowGenerator will fail because it's looking for SpecFlow 2.2, which we don't want to use in the pre-conversion branch because of the NUnit issue.
I'd love to not have to swap out the extension, as long as I can continue to switch branches between one that uses SpecFlow 2.1 and one that uses 2.2. The app.config for the project does contain a binding redirect -
<dependentAssembly>
<assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.1.0" newVersion="2.1.0.0" />
</dependentAssembly>
So the question is how to use the up-to-date extension even when bouncing between branches that use 2.1 and 2.2. Thanks again!
The Visual Studio extension supports all versions of SpecFlow from 1.9 up to 2.2.
If you have problems with it, please open an issue on GitHub, so that we can find the reason together.
Update:
SpecFlow has no direct reference to NUnit. Not with 2.2 or anything before. There is a NuGet package SpecFlow.NUnit which has a package dependency to NUnit, but this package helps only configuring SpecFlow for NUnit. But you don't need this, when you are doing the configuration manually (setting the unit test provider to NUnit in the app.config).
It could be, that when you are switching branches and don't restart Visual Studio between, that we have still a reference to the previous SpecFlow assemblies and so a Version hickup is created.
Full disclosure: I am one of the maintainer of SpecFlow.
In case anyone else wrestles with this, here's the fix that worked for me with this particular sequence of events
1) you have a branch that uses SpecFlow 2.1
2) you upgrade to the latest VS SpecFlowExtension
3) you switch to another branch that uses SpecFlow 2.2 and successfully have the feature.cs generated
4) you get a request from a user needing support on 2.1, switch to that branch, make a change to a feature file, and get slammed with SpecFlow 2.2 not found
5) even after closing all instances of VS, deleting LocalAppData/Temp/VisualStudioTestExplorerExtensions, starting VS and opening the solution that uses the SpecFlow 2.1 drivers, then attempting to save still results in SpecFlow 2.2 not found, even with a binding redirect to 2.1
Apparently something is cached to disk (reboots didn't help) that isn't immediately apparent. The solution was to have separate clones - one for the branch that referenced SpecFlow 2.1 and an entirely separate clone for the branch that referenced SpecFlow 2.2.
Now I no longer get SpecFlow Generator errors - the trick is not to use separate branches, but separate clones.

Nant build issue: Failed to initialize the Microsoft .NET compact framework

i have some problems regarding building .NET solution for handheld device using NAnt 0.92. The solution consists of typical csproj and CAB installer (vddproj). The target platform is .NET CF 3.5.
However, if i set the target platform in the script as:
< property name="nant.settings.currentframework" value="netcf-3.5" />
when i execute then i receive an error:
Target framework could not be changed. "netcf-3.5" is not a valid framework identifier.
This means that i cannot build solutions for target platform 3.5. Logically, i have tried with CF 2.0 afterwards:
< property name="nant.settings.currentframework" value="netcf-2.0" />
and then i receive an error
Failed to initialize the 'Microsoft .NET Compact Framework 2.0' (netcf-2.0) target framework. Registry path not found! - key = 'SOFTWARE\MICROSOFT......'
I have the proper SDK installed as some other posts suggested. Also, tried to disable the antivirus, as also suggested in similar posts, but couldn't find any solution.
Can you give any advice, please?
Thank you in advance. Daniel
I know it's a bit late but I would suggest that you're using NAnt only to trigger MSBuild.exe. Thats what we're doing in our CI environment and it works perfectly. Also make sure that your project is a smart device project or else it won't build correctly. I'm not even sure if NAnt supports the CF 3.5 (anymore).

Way to debug mixed JNI code?

I've been looking around to find an easy way to debug my JNI code, you know, to be able to freely jump into native code and back into java code.
The solutions which I found were sort of out of date or got some restrictions. Some required specific ndk version, some required specific Eclipse version. Here my target is Android 1.6 & 2.2, I'm using Eclipse 3.6 Helios, and NDK r5b. Is there a general solution for this mixed debugging? Thx.
Citate from $NDK/docs/NDK-GDB.html:
IMPORTANT: Native debugging can only work if all these conditions are met:
1. Your application is built with the 'ndk-build' script:
Building with the legacy "make APP=<name>" method is not
supported by ndk-gdb.
2. Your application is debuggable:
In other words, your AndroidManifest.xml has an <application>
element that sets the android:debuggable attribute to "true"
3. You are running your application on Android 2.2 (or higher):
ndk-gdb will not work if you try to run your application on
previous versions of the system. That does not mean that your
application should target the Android 2.2. API level, just
that the debugging session should happen on a 2.2+ device or
emulator system image.
so, you can't use device with 1.6.
How to setup environment to debug jni code: i used this recipe, it works for me.