This does seem to be working better now with the latest version, thanks!
Here’s another question related to all of this: would you expect “dotnet publish” to work for Elements projects?
Right now, if I try to use “dotnet publish”, I get this error:
C:\Users\alovhaug\source\repos\DotnetPublishTest>dotnet publish -c Release
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Users\alovhaug\source\repos\DotnetPublishTest\DotnetPublishTest\DotnetPublishTest.elements : warning NU1503: Skipping restore for project 'C:\Users\alovhaug\source\repos\DotnetPublishTest\DotnetPublishTest\DotnetPublishTest.elements'. The project file may be invalid or missing targets requi
red for restore. [C:\Users\alovhaug\source\repos\DotnetPublishTest\DotnetPublishTest.sln]
Determining projects to restore...
C:\Program Files\dotnet\sdk\6.0.302\NuGet.targets(130,5): warning : Unable to find a project to restore! [C:\Users\alovhaug\source\repos\DotnetPublishTest\DotnetPublishTest.sln]
C:\Users\alovhaug\source\repos\DotnetPublishTest\DotnetPublishTest\DotnetPublishTest.elements(60,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\6.0.302\RemObjects Software\Elements\RemObjects.Elements.targets" was not found. Confirm that the expression in the Import decla
ration "C:\Program Files\dotnet\sdk\6.0.302\\RemObjects Software\Elements\RemObjects.Elements.targets" is correct, and that the file exists on disk.
FYI: I do not have a \RemObjects folder in 6.0.302.
What I like about “dotnet publish” when testing it with a C# project is that it seems to produce a folder where everything is organized correctly for deployment.
- The /bin contents (the DLLs, the *.deps.json, appsettings.json, etc.) are in the root of this “publish” folder.
- The wwwroot folder is also placed in this folder.
- It even seems to be generating a web.config, which I will need for IIS deployments.
This means that after using “dotnet publish”, I can just copy the contents of a single folder over to my deployment server.
Obviously this isn’t a big deal, but it would be nice if this was also supported.
Thanks,
–Avonelle