Wisej Publish for a Docker container and Gitlab CI/DI does not work

1
0

I would like to execute the command
 dotnet publish -f “MyProject.csproj” -c Release -o /app/publish

I need it to be able to run a CI/CD on Gitlab, with a Razor project everything works fine.

With WiseJ it doesn’t, there is no standard structure of a Razor project but a mix of old (ASP.Net) and new method (ASP .Net Core).

The following error is generated:

NETSDK1129: The ‘Publish’ target is not supported without specifying a target framework. The current project targets multiple frameworks, you must specify the framework for the published application. [/src/WiseDashNav/MyProject.csproj].

Naturally, I tried to specify the correct framework in the MyProject.csproj file:
<TargetFrameworks>net6.0</TargetFrameworks>.
then
<TargetFramework>net6.0</TargetFramework>.

The next error is :
NETSDK1013 error: TargetFramework ‘WiseOpera.csproj’ value was not recognised. It may have been spelled incorrectly. Otherwise, the TargetFrameworkIdentifier and / or TargetFrameworkVersion properties must be explicitly specified. [/src/WiseDashNav/MyProject.csproj].

I also tried setting the ‘TargetFrameworkIdentifier’ and/or ‘TargetFrameworkVersion’ properties, but no luck.

It seems that with WiseJ it is complicated to use in conjunction with standards such as Docker and ASP .Net Core projects

Can anyone give me a hint?
Thanks

  • You must to post comments
0
0

Hi Tiziano,

The issue is that you’ll have to specify the target framework and runtime for the “dotnet publish” command!

The fix would be the following:

dotnet publish -f “MyProject.csproj” -c Release -o /app/publish —framework net6.0 —runtime linux-x64 

You don’t have to fiddle with the .csproj files, it’s not a Wisej.NET issue!

You can take a look at all the Target Frameworks Identifiers here: https://docs.microsoft.com/en-us/dotnet/standard/frameworks

 

And the Runtime Identifiers from here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog

From there you can containerize your app and use it in GitLab!

HTH,

Alaa

  • Tiziano Salardini
    Hi Alaa, Thanks for your help, I managed to make it work! Thank you Regards
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.