Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnlib is not found when building in a pipelin using Confuser.MSBuild 1.6.0 #477

Closed
Kratheon opened this issue Apr 13, 2022 · 8 comments
Closed
Labels
feedback-required This issue can't be processed further until additional information are provided. inactive This issue requires some feedback, but did not get any response. potential-bug Something does not seem to be working

Comments

@Kratheon
Copy link

  • ConfuserEx Version: Confuser.MSBuild v.1.6.0
  • Target Framework: .Net Framework 4.7.2 and/or .Net Standard 2.0
  • Operating System: Windows Server 2019

Steps to Reproduce:

  1. Create a pipeline in Azure Devops or any CI Pipeline in general
  2. Build the project where you integrated the confuser.MsBuild in order to obfusacte the .dll generated by the build process

ConfuserMSBuildErrorCSPROJ
ConfuserMSBuildErrorReferences
ConfuserMSBuildError

As you can see in the last image, it seems that during the ConfuseTask in the building process of a pipeline, ConfuserEx is not able to find the dnlib.dll

I don't have this problem when I build the project in Visual Studio 2022.

I aldready tried to give the dnlib.dll (v.3.4.0) by adding it in the project root (and copy it in the output directory in the csproj)or adding a probePath in the crproj giving the path of dnlib.dll

Any ideas what I am missing or it is even possible to use Confuser.MsBuild in a pipeline building process ?

@Kratheon Kratheon added potential-bug Something does not seem to be working triage This issue needs some initial analysis. labels Apr 13, 2022
@mkaring
Copy link
Owner

mkaring commented Apr 15, 2022

My best guess is that your build pipeline is running using the .NET Core version of MSBuild instead of the full version. The .NET Core version does not work with ConfuserEx yet. Only the full msbuild that is part of Visual Studio and the Visual Studio Build Tools works correctly.

@mkaring mkaring added feedback-required This issue can't be processed further until additional information are provided. and removed triage This issue needs some initial analysis. labels Apr 15, 2022
@jkarpio
Copy link

jkarpio commented Apr 18, 2022

Jetbrain Rider, .NET4.8 with new project format, using Microsoft Build Engine version 17.1.0+ae57d105c for .NET

Confuser.MSBuild.targets(74, 5): [MSB4018] The "Confuser.MSBuild.Tasks.ConfuseTask" task failed unexpectedly.
System.AggregateException: One or more errors occurred. (Could not load file or assembly 'dnlib, Version=3.4.0.0, Culture=neutral, PublicKeyToken=50e96378b6e77999'. The system cannot find the file specified.
)
---> System.IO.FileNotFoundException: Could not load file or assembly 'dnlib, Version=3.4.0.0, Culture=neutral, PublicKeyToken=50e96378b6e77999'. The system cannot find the file specified.
File name: 'dnlib, Version=3.4.0.0, Culture=neutral, PublicKeyToken=50e96378b6e77999'
at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token)
at Confuser.Core.ConfuserEngine.<>c__DisplayClass3_0.b__0() in C:\projects\confuserex\Confuser.Core\ConfuserEngine.cs:line 69
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- 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 System.Threading.Tasks.Task.Wait()
at Confuser.MSBuild.Tasks.ConfuseTask.Execute() in C:\projects\confuserex\Confuser.MSBuild.Tasks\ConfuseTask.cs:line 33
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

@Kratheon
Copy link
Author

My best guess is that your build pipeline is running using the .NET Core version of MSBuild instead of the full version. The .NET Core version does not work with ConfuserEx yet. Only the full msbuild that is part of Visual Studio and the Visual Studio Build Tools works correctly.

Yeah, it seems it was that.
Msbuild 17.1 worked fine in the pipeline. Thanks for the answer ! :D

@github-actions
Copy link

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

@github-actions github-actions bot added the inactive This issue requires some feedback, but did not get any response. label May 11, 2022
@Dimitory
Copy link

Dimitory commented May 13, 2022

I've fixed this for me - #488
Could you publish nuget package asap?:)

@github-actions github-actions bot removed the inactive This issue requires some feedback, but did not get any response. label May 14, 2022
@github-actions
Copy link

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

@github-actions github-actions bot added the inactive This issue requires some feedback, but did not get any response. label May 29, 2022
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

Closing this issue because it needs more information and has not had recent activity. Please re-open this issue if more details can be provided. Thanks!

@github-actions github-actions bot closed this as completed Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Jul 6, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feedback-required This issue can't be processed further until additional information are provided. inactive This issue requires some feedback, but did not get any response. potential-bug Something does not seem to be working
Projects
None yet
Development

No branches or pull requests

4 participants