Samsung / Tizen.NET

Welcome to Tizen .NET
Other
210 stars 30 forks source link

Workload creates wrong manifest for dll with a hyphen in it. #264

Closed HJLeee closed 8 months ago

HJLeee commented 11 months ago

Please refer the following for reproduction.

· ~/tmp/tizen-workload $ dotnet new tizen -n tizen-workload
The template "Tizen .NET Application" was created successfully.

· ~/tmp/tizen-workload $ cd tizen-workload/
· ~/tmp/tizen-workload/tizen-workload $ ls
Main.cs  shared  tizen-manifest.xml  tizen-workload.csproj

· ~/tmp/tizen-workload/tizen-workload $ dotnet build
MSBuild version 17.4.8+6918b863a for .NET
  Determining projects to restore...
  Restored /home/leee/tmp/tizen-workload/tizen-workload/tizen-workload.csproj (in 68 ms).
  tizen-workload -> /home/leee/tmp/tizen-workload/tizen-workload/bin/Debug/net7.0-tizen/tizen-workload.dll
  tizen-workload is signed with Default Certificates!

tizen-manifest.xml : error TS0002: The 'tizen_workload.dll' file was not found. [/home/leee/tmp/tizen-workload/tizen-workload/tizen-workload.csproj]
tizen-manifest.xml : error TS0002: Please check the exec attribute of tizen-manifest.xml or check the assembly name [/home/leee/tmp/tizen-workload/tizen-workload/tizen-workload.csproj]

Build FAILED.

tizen-manifest.xml : error TS0002: The 'tizen_workload.dll' file was not found. [/home/leee/tmp/tizen-workload/tizen-workload/tizen-workload.csproj]
tizen-manifest.xml : error TS0002: Please check the exec attribute of tizen-manifest.xml or check the assembly name [/home/leee/tmp/tizen-workload/tizen-workload/tizen-workload.csproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.51

· ~/tmp/tizen-workload/tizen-workload $ ls bin/Debug/net7.0-tizen/
publish  tizen-workload.deps.json  tizen-workload.dll  tizen-workload.pdb  tizen-workload.runtimeconfig.json  tpkroot

· ~/tmp/tizen-workload/tizen-workload $ cat tizen-manifest.xml 
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="7" package="com.companyname.tizen_workload" version="1.0.0">
  <profile name="common" />
  <ui-application appid="com.companyname.tizen_workload"
          exec="tizen_workload.dll"
          type="dotnet"
          multiple="false"
          taskmanage="true"
          nodisplay="false"
          launch_mode="single">
    <label>tizen_workload</label>
    <icon>tizen_workload.png</icon>
    <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
  </ui-application>
</manifest>
rookiejava commented 11 months ago

good catch! Seems like this issue stems from the Safe Naming Rule of dotnet templating.

E.g, if user use My-App as the name, the generated content will be as follows:

Form | Source | Transformed value -- | -- | -- identity | My-App | My-App namespace | My-App | My_App class name | My-App | My_App lower case namespace | My-App | my_app lower case class name | My-App | my_app

However, the tizen-manifest.xml file doesn't recognize the names converted according to this rule.

@sung-su, @JoonghyunCho could you check and make sure the tizen-manifest.xml file aligns with orginal name when it genereted?

JoonghyunCho commented 11 months ago

Here are the options I can think of right now to fix the issue:

  1. Keep the user specified name, tizen-workload, for exec value. : Looks most preferred, but not simple. More investigation is required for conditional template generation.
  2. Add <AssemblyName>TizenApp1</AssemblyName> property in TizenApp1.csproj to make the name of dll fit to the naming rule. : Easy to apply, but then it is Tizen specific. Not sure if there could be the side effects.

Let me more think about the solution.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days