ASP.NET Core Mercury App Deployment to IIS Guidance?

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

Cool!

Probably not, since dotnet doesn’t know about Elements. anything that works on the project file, won’t work. dotnet x.dll to run the executable, and potentially other tasks that just work on the output, will/should work.

It’s odd that it complains about the missing .targets file if the path is correct. But even if it didn’t, it would not work, as (non-legacy) .elements projects/targets ar enot set up to work with msbuild or dotnet.

Setting Publish to true in Project Settings, EBuild should do the same (but let me know if it’s missing anything, as not many people have used this yet, I think).

Very cool! I tried this out, and it does seem to be generating exactly what I would want - even the web.config! I haven’t actually tested the output yet, but at least for now this appears to me to be exactly what I would want. Excellent!

–Avonelle

1 Like

That makes me happy to hear!