question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't publish C# DLL on .NETCore

See original GitHub issue

Steps to reproduce:

  • DllExport -version: 1.7.3
  • Used Visual Studio 2019

Information from Data tab or log data:

Every time I try to publish my DLL by right clicking and hitting publish I set target to my local folder configuration release, target framework .netcoreapp3.0 target runtime win-x64

The build and rebuild work fine but whenI publish I receive the following message " Publishing has encountered an error. Publishing has failed

A Diagnostic log has been written to the following location: “c:\User.…\AppData\Local\Temp\filename.tmp” "

Checking the file I receive an error that does not help very much:

2020-0

8-24 1:20:00 PM System.AggregateException: One or more errors occurred. —> System.Exception: Publishing failed. — End of inner exception stack trace — at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>b__2() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__202.MoveNext() —> (Inner Exception #0) System.Exception: Publishing failed.<—

System.Exception: Publishing failed.

===================

My code is no more than the following class:

using System; using System.Runtime.InteropServices;

namespace ClassLibrary2 { public class Class1 { [DllExport(“Add2”, CallingConvention.Cdecl)] public static int testAdd(int a, int b) { return a + b; }

    [DllExport("Say2", CallingConvention.Cdecl)]
    public static void sayWhatever()
    {
        Console.WriteLine("it workss");
    }
}

}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mikasoukhovcommented, Dec 5, 2020

Think the reason was described here https://github.com/3F/DllExport/issues/175

Now no official instruction works with VS. Neither bat, no Nuget. Maybe someone will publish a quick solution or update the instruction. New projects for .NET Core is fully unsupportable )

1reaction
3Fcommented, Dec 4, 2020

@supermartzin,

… pdb to be packed was not found on disk.

Your problem seems a bit different comparing this issue. Could you please open a new one. Thanks!

@mikasoukhov,

Seems for .NET Core dll injection is not supported anymore.

Make sure you’re using my custom IL assembler together with rebasing (see related options) // #123 I can’t say anything else without requested information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dotnet publish not publishing DLL to publish directory
NET Core (2.2) application, however one specific NuGet package ( Microsoft.Management.Infrastructure ) is never published to the publish folder ...
Read more >
NET application publishing overview
NET runtime. Publishing an app as framework-dependent produces a cross-platform binary as a dll file, and a platform-specific executable that ...
Read more >
Too many dlls when publishing dotnet
dotnet publish -c Release -r win10-x64 --self-contained ... Remember, I'm on linux, so I can't keep deleting dlls and seeing if my program....
Read more >
Why isn't my ASP.NET Core app in Docker working?
NET Core app running in Docker respond when I try and navigate to it? ... -c Release -o /app/build FROM build AS publish...
Read more >
Publishing A Single EXE File In .NET Core 3.0
dotnet publish -r win-x64 -c Release --self-contained ... It doesn't break anything to not do so, but all those old DLL's just hang...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found