Can't publish C# DLL on .NETCore
See original GitHub issueSteps 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:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
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 )
@supermartzin,
Your problem seems a bit different comparing this issue. Could you please open a new one. Thanks!
@mikasoukhov,
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.