I’ve completed creating and testing my application and am ready to publish to Mochahost.
I’ve used visual studio and Mochahost publish profile to attempt to publish my application and receive errors :
Build started at 1:49 PM…
1>—— Build started: Project: CopyPaste, Configuration: Release Any CPU ——
1>CopyPaste -> D:\Survey Projects\CopyPasteTranslatedTexts\CopyPaste48\bin\CopyPaste.dll
2>—— Publish started: Project: CopyPaste, Configuration: Release Any CPU ——
CopyPaste -> D:\Survey Projects\CopyPasteTranslatedTexts\CopyPaste48\bin\CopyPaste.dll
CopyPaste -> D:\Survey Projects\CopyPasteTranslatedTexts\CopyPaste48\obj\Release\net48\PubTmp\Out\
C:\Program Files\dotnet\sdk\9.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CrossTargeting.targets(31,5): Error NETSDK1129: The ‘Publish’ target is not supported without specifying a target framework. The current project targets multiple frameworks, you must specify one of the following frameworks in order to publish: net48
When I specify any .NET 48, 7,8, or 9 it gives me the same error and won’t publish.
Can anyone please advise?
Thanks
Hi
I suggest you should confirm with Mochahost which .NET versions they support. If their hosting environment does not support newer versions like .NET 7, 8, or 9, you’ll need to adjust your project to target a compatible version, such as .NET Framework 4.8
Also you can test your app with other hosting that support you desired .net version. I use somee host and works perfect. (4.8 and 8)
If your app run good on your machine, is not wisej issue 🙂
Regards
Please login first to submit.