语言

Menu
Sites
Language
Visual Studio 2019 not fully supported yet?

I am pretty noob, but I tried VS 2019 for Tizen development. Installation worked fine and tools open emulator and other stuff well and I can create new Tizen projects. But thats it, somehow there is problems with nuget to attach required dependencies. Situation is same if I create new Tizen project or open a sample from official github samples. Somehow VS2019 says that it even cant find System in "using System;" I also tried to open and create simple Xamarin projects and everything works fine, no problem with build or anything. So I think no problem with my VS2019. I tried several time to uninstall Tizen sdk/studio and also VS2019. Eventually I installed VS2017 and somehow everything works well in VS2017, no problems with Tizen there.
Any comments?

查看选择的答案

响应

9 回复
Tizen .NET

In the latest VS2019 (16.0 or higher version), there were some changes to the visual studio project-system, which caused errors in projects using existing Tizen.Net.Sdk. I'm not sure if the issue you're talking about is the same thing because I don't have enough information, but I recommend you try to apply follwing guide to your tizen project (*.csproj).

 <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>tizen40</TargetFramework>
    <!-- Add below 2 lines to your *.csproj. -->
    <!-- Specifiy TargetFrameworkIdentifier and TargetFrameworkVersion to avoid Tizen TFM issue on VS2019 -->
    <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
 </PropertyGroup>

If the problem still persists, please provide more information (e.g. version, error messages, screen shots, ...). Thank you.

Ran Saar

Because it works in VS2017 and for me VS2017 and VS2019 are not so different. I have no resources to try it again and log all the errors. Thank you for response.

Morten Nielsen

I reported this back in February (https://developer.tizen.org/forums/tizen-.net/feedback-on-tizen-.net-tooling-1-out-5-stars) , but their manifest still claims to support VS2019 (in fact it claimed it supported it before 2019 even existed). The manifest takes a hard dependency on a VS2017 component yet still claims it can run on VS2019. So yes it goes very wrong. 

It would be nice if they would at least fix the manifest to stop claiming to support 2019 until they can actually get it fixed. But generally the tooling for Tizen has been so abysmal I don't have high hopes there.

Tizen .NET

I'm sorry for hearing that. It looks like there is a misunderstanding.

Let's dig into what is the problem.

First, Visual Studio Tools for Tizen is support VS2019.

But, as I mentioned above, existing Tizen projects using Tizen.NET.SDK 1.0.0 or 1.0.1 occur some error on lastest Visual Studio 2019 (16.1 or higher) as follow. 

Severity    Code	Description	Project	File	Line	Suppression State
Error	NETSDK1013	The TargetFramework value 'tizen40' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.	AnalogWatch.Tizen.Wearable	C:\Program Files\dotnet\sdk\2.1.700\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets	96	
This is due to recent changes of visual studio project system.  To resolve this issue, we provide 2 options
 
1) Using Tizen.NET.Sdk 1.0.3
     Since Tizen.NET.Sdk 1.0.3, it can be used as a custom SDK of MSBuild. So, it works well on latest VS2019.
<Project Sdk="Tizen.NET.Sdk/1.0.3">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>tizen40</TargetFramework>
  </PropertyGroup>

</Project>

 

2) Using in old way (Microsoft.NET.Sdk)

   If you want to use existing Tizen proejct using legacy Tizen.NET.Sdk, you can just add below 2 lines to your csproj.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>tizen40</TargetFramework>
    <!- Workaround: Set TargetFrameworkIdentifier to avoid Tizen TFM issue on VS2019 -->
    <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier> 
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </PropertyGroup>

</Project>

Other than that, we have no specific bug reporting after releasing last update (2.5.0.0) of Visual Studio Toots for Tizen on last updated on 17 Apri 2019.

@morten-nielsen If you are still experiencing problems with the VS tools for Tizen 2.5.0.0, please share your details. It would be great help to sovle the real problem. We'll try harder. Thanks.

Ran Saar

Thank you for extra information. I just made for test a new Tizen Wearable app for Tizen 4.0. and got the same errors as before in VS2019.

I use latest Tizen Tools 2.5.0.0 from marketplace. This blank project uses Tizen.Net 4.0.0, Tizen.NET.sdk 1.0.1, Tizen.Wearable.CircularUI 1.0.0, Xamarin.Forms 3.2.0.871581. So if it is fixed, how does it still use Tizen.NET.Sdk 1.0.1 and not Tizen.NET.Sdk 1.0.3 for example?

I got this error in Error List:

Error    NETSDK1013   
The TargetFramework value 'tizen40' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.    
TizenWearableApp11    
File: C:\Program Files\dotnet\sdk\2.1.700\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets    
Line: 96    

 

And error log file:

=====================
6/25/2019 19:41:57
Recoverable
System.AggregateException: One or more errors occurred. ---> NuGet.Frameworks.FrameworkException: Invalid framework identifier ''.
   at NuGet.Frameworks.NuGetFramework.GetShortFolderName(IFrameworkNameProvider mappings)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.<>c.<ToPackageSpec>b__11_0(TargetFrameworkInformation tfi)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.ToPackageSpec(ProjectNames projectNames, IEnumerable TargetFrameworks, String originalTargetFrameworkstr, String msbuildProjectExtensionsPath)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.ToDependencyGraphSpec(ProjectNames projectNames, IVsProjectRestoreInfo projectRestoreInfo, IVsProjectRestoreInfo2 projectRestoreInfo2)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.NominateProjectAsync(String projectUniqueName, IVsProjectRestoreInfo projectRestoreInfo, IVsProjectRestoreInfo2 projectRestoreInfo2, CancellationToken token)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.NominateProjectAsync(String projectUniqueName, IVsProjectRestoreInfo2 projectRestoreInfo, CancellationToken token)
   at Microsoft.VisualStudio.ProjectSystem.VS.PackageRestore.PackageRestoreInitiator.PackageRestoreInitiatorInstance.<NominateProjectRestoreAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__68.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.PackageRestore.PackageRestoreInitiator.PackageRestoreInitiatorInstance.<OnRestoreInfoChangedAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
   --- End of inner exception stack trace ---
---> (Inner Exception #0) NuGet.Frameworks.FrameworkException: Invalid framework identifier ''.
   at NuGet.Frameworks.NuGetFramework.GetShortFolderName(IFrameworkNameProvider mappings)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.<>c.<ToPackageSpec>b__11_0(TargetFrameworkInformation tfi)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.ToPackageSpec(ProjectNames projectNames, IEnumerable TargetFrameworks, String originalTargetFrameworkstr, String msbuildProjectExtensionsPath)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.ToDependencyGraphSpec(ProjectNames projectNames, IVsProjectRestoreInfo projectRestoreInfo, IVsProjectRestoreInfo2 projectRestoreInfo2)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.NominateProjectAsync(String projectUniqueName, IVsProjectRestoreInfo projectRestoreInfo, IVsProjectRestoreInfo2 projectRestoreInfo2, CancellationToken token)
   at NuGet.SolutionRestoreManager.VsSolutionRestoreService.NominateProjectAsync(String projectUniqueName, IVsProjectRestoreInfo2 projectRestoreInfo, CancellationToken token)
   at Microsoft.VisualStudio.ProjectSystem.VS.PackageRestore.PackageRestoreInitiator.PackageRestoreInitiatorInstance.<NominateProjectRestoreAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__68.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.PackageRestore.PackageRestoreInitiator.PackageRestoreInitiatorInstance.<OnRestoreInfoChangedAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---

===================

 

Hope this helps a little bit.

 

Tizen .NET

Thank you for sharing information. Please refer to https://samsung.github.io/Tizen.NET/tizen%20.net/Using-Tizen-NET-Sdk-as-SDK-style/.

It would be great if you can attach or show your tizen proejct (*.csproj).

 

Ran Saar

Article "Using Tizen.NET.Sdk as SDK-style" was very helpful. I managed to get it work in VS2019. As I have experienced in Tizen developer portal, answers here and also in that article the information is minimal and this make hard to get into Tizen .Net development. I have not found any books or courses in Tizen .net development, so every information on web is most valuable, but if it is so short and information is concentrated, I have to read it like ten times to understand it as I am not professional.

So, but the main question remains. Why I can't create new Tizen project in VS2019 by using Tizen.NET.Sdk as main sdk and not Microsoft.NET.Sdk? Why VS2019 still create a project the old way there main is Microsoft.NET.Sdk and the Tizen.NET.Sdk is included as PackageReference? Why it is still needed to change it manually in .csproj to make it work?

Its a little bit out of topic, but why now the project uses Tizen.NET 5.0.0 and not ver. 4.0 as <TargetFramework>tizen40</TargetFramework> written in .csproj? And are Tizen 5 and Tizen.NET 5 somehow related because both are version 5?

 

PS! The link "dotnet/project-system#4854" is not working in the article, link address is :
https://samsung.github.io/Tizen.NET/tizen%20.net/Using-Tizen-NET-Sdk-as-SDK-style/(https://github.com/dotnet/project-system/issues/4854)

Mark as answer
Tizen .NET

So, but the main question remains. Why I can't create new Tizen project in VS2019 by using Tizen.NET.Sdk as main sdk and not Microsoft.NET.Sdk? Why VS2019 still create a project the old way there main is Microsoft.NET.Sdk and the Tizen.NET.Sdk is included as PackageReference? Why it is still needed to change it manually in .csproj to make it work?

=> We found the problem in latest VS2019 (16.1 or above) and tried to find a way to solve it. Fortunately, we found the cause of the problem, we shared a temporaily solution for existing users . Since it took time for internal testing to deploy the new VS Tools for Tizen, we recommended to modify it manually. Now that the new version has been released, you can use it without any modification if you update VS Toos for Tizen to 2.6.0.0.

 

Its a little bit out of topic, but why now the project uses Tizen.NET 5.0.0 and not ver. 4.0 as <TargetFramework>tizen40</TargetFramework> written in .csproj? And are Tizen 5 and Tizen.NET 5 somehow related because both are version 5?

=> The version of Tizen.NET Package is not meant to version of TargetFramework directly.  Unlike Tizen .NET  4.0.0 (it supports only for tizen40 target framework),  Tizen .NET 5.0.0 supports both tizen40 and tizen50.

 

Plus, thank you for reporting link error. We'll fix it soon. :)

Ran Saar

Thank you, I updated Tizen extention in VS2019 and it works now. Somehow then creating project there are still the same package not found style warning icons under dependencies, but if I wait 5 seconds everything is solved automatically and works great.