C
C#3mo ago
flor

i need help!

i start using .net core 8 and it use dll instead of exe commpile
79 Replies
Jimmacle
Jimmacle3mo ago
what type of project did you create?
flor
flor3mo ago
No description
flor
flor3mo ago
@jIMMACLE windows
Angius
Angius3mo ago
What type of project, though, as you were creating it Console? Windows Forms? Class Library?
flor
flor3mo ago
windows forms
Jimmacle
Jimmacle3mo ago
so where are you not seeing an exe?
flor
flor3mo ago
No description
Jimmacle
Jimmacle3mo ago
that is what it should look like
flor
flor3mo ago
program.dll is the source code
Angius
Angius3mo ago
Well I see an exe there
flor
flor3mo ago
dude i put the program.dll
Jimmacle
Jimmacle3mo ago
do you want $singlefile?
MODiX
MODiX3mo ago
dotnet publish -c Release -r <runtime identifier> -p:PublishSingleFile=true Use of -p:PublishSingleFile=true implies --self-contained true. Add --self-contained false to publish as runtime-dependent. -r RID and -p:PublishSingleFile=true can be moved to .csproj as the following properties:
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
but to target multiple RIDs, you have to use dotnet publish with the -r option for each RID. You can also add -p:IncludeNativeLibrariesForSelfExtract=true to include native libraries (like Common Language Runtime dlls) in the output executable. You might want to instead publish your application compiled Ahead Of Time to native code, see $nativeaot for examples. Single file publishing | Runtime Identifier (RID) catalog | dotnet publish
flor
flor3mo ago
in dnspy
Jimmacle
Jimmacle3mo ago
yes, that is exactly what it should have
flor
flor3mo ago
program.dll sourcecode
Angius
Angius3mo ago
And it showed you the decompiled source code, yeah So? That's what it does
Jimmacle
Jimmacle3mo ago
modern .NET executables compile to a DLL with a platform specific stub to launch the program if you want it to be all one file, look at the modix message
flor
flor3mo ago
i was using framework 4.8 i mean ok there can be dll
Jimmacle
Jimmacle3mo ago
which works differently
flor
flor3mo ago
but the problem is it build as dll not exe
Jimmacle
Jimmacle3mo ago
and i'm trying to tell you that's not a problem that is how it's supposed to work
flor
flor3mo ago
so what i have to do ?
Jimmacle
Jimmacle3mo ago
nothing
flor
flor3mo ago
lol what
Jimmacle
Jimmacle3mo ago
there is nothing wrong you are misunderstanding what it should look like
flor
flor3mo ago
how i can use obf then
Jimmacle
Jimmacle3mo ago
what is obf
flor
flor3mo ago
obfuscate
Jimmacle
Jimmacle3mo ago
don't, because it's pointless
Angius
Angius3mo ago
$obfuscation
MODiX
MODiX3mo ago
"Then finally, there is that question of code privacy. This is a lost cause. There is no transformation that will keep a determined hacker from understanding your program. This turns out to be true for all programs in all languages, it is just more obviously true with JavaScript because it is delivered in source form. The privacy benefit provided by obfuscation is an illusion. If you don’t want people to see your programs, unplug your server." - Douglas Crockford https://softwareengineering.stackexchange.com/a/155133 * Spend your effort on putting proprietary things in your api, and keeping the distributed code as empty as possible * Use AuthN/AuthZ to control who/what/when/etc... * Free obfuscation is worth the amount your paid for it -- it's already broken and most decompilers out there can make sense of it. * Paid ofbuscation will bankrupt you unless you have a very strong revenue stream and can justify the additional cost with gained sales * The "threat" of someone hijacking your UI and shimming it to make it provide them money is not a real threat. If this is legitimate software, you can ruin their business with lawsuits - Cisien
Software Engineering Stack Exchange
Is it important to obfuscate C++ application code?
In the Java world, sometimes it seems to be a problem, but what about C++? Are there different solutions? I was thinking about the fact that someone can replace the C++ library of a specific OS wit...
Angius
Angius3mo ago
It's unlikely that your code is worth the license cost of the obfuscators that somehow work
flor
flor3mo ago
okay can u change the dll name to different and exe name to differennt
Jimmacle
Jimmacle3mo ago
sure, change your project settings
flor
flor3mo ago
if yes how where
flor
flor3mo ago
No description
Angius
Angius3mo ago
That's a namespace setting visual studio dotnet change exe name in your search engine of choice is bound to have results
flor
flor3mo ago
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>False</SignAssembly>
<PackageOutputPath>$(SolutionDir)bin\Release</PackageOutputPath>
<BaseOutputPath>bin\Release\net8.0-windows</BaseOutputPath>
<OutputType>WinExe</OutputType>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>False</SignAssembly>
<PackageOutputPath>$(SolutionDir)bin\Release</PackageOutputPath>
<BaseOutputPath>bin\Release\net8.0-windows</BaseOutputPath>
<OutputType>WinExe</OutputType>
</PropertyGroup>
my settings like this its good?
Angius
Angius3mo ago
I don't see it specify the name anywhere So while they look like they would work, unlikely they would change the exe name
flor
flor3mo ago
okay where do i change the dll name and exe
Angius
Angius3mo ago
Here, did the googling for you: https://stackoverflow.com/a/44188341/6042255
flor
flor3mo ago
its not possible?
Angius
Angius3mo ago
It very much is possible
flor
flor3mo ago
thannks alot to compile just exe
Angius
Angius3mo ago
You just gotta use search engines This wasn't even google, this was Bing It is possible to compile to a single file, yes $singlefile
MODiX
MODiX3mo ago
dotnet publish -c Release -r <runtime identifier> -p:PublishSingleFile=true Use of -p:PublishSingleFile=true implies --self-contained true. Add --self-contained false to publish as runtime-dependent. -r RID and -p:PublishSingleFile=true can be moved to .csproj as the following properties:
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
but to target multiple RIDs, you have to use dotnet publish with the -r option for each RID. You can also add -p:IncludeNativeLibrariesForSelfExtract=true to include native libraries (like Common Language Runtime dlls) in the output executable. You might want to instead publish your application compiled Ahead Of Time to native code, see $nativeaot for examples. Single file publishing | Runtime Identifier (RID) catalog | dotnet publish
flor
flor3mo ago
i have dotnet but it sstart say The system cannot find the file specified. Visual Studio 2022 Developer Command Prompt v17.9.1 Copyright (c) 2022 Microsoft Corporation i put in there the comment
Angius
Angius3mo ago
No description
Angius
Angius3mo ago
No description
Angius
Angius3mo ago
This will show you the steps to do it with VS instead of the CLI
flor
flor3mo ago
i dont have this section
Angius
Angius3mo ago
Did you try scrolling down on the page?
Angius
Angius3mo ago
flor
flor3mo ago
sorry isee
flor
flor3mo ago
No description
flor
flor3mo ago
like this right,*
Angius
Angius3mo ago
If that's what the documentaton says, then yes Looks fine
flor
flor3mo ago
No description
flor
flor3mo ago
i just go folder right?
Angius
Angius3mo ago
Yes
flor
flor3mo ago
No description
Angius
Angius3mo ago
Folder
flor
flor3mo ago
No description
Angius
Angius3mo ago
Pick whatever location you want here, any random empty folder I like just builds\ but anything works
flor
flor3mo ago
No description
flor
flor3mo ago
i make same as u
Angius
Angius3mo ago
If you mean using builds\ then no, you didn't But this will work
flor
flor3mo ago
i did the settings like this
flor
flor3mo ago
No description
flor
flor3mo ago
now? this one not gonna work?
Angius
Angius3mo ago
It will work As I said, whatever directory works Makes no difference And yes, the settings having Produce single file checked is fine Self-contained is not needed, but also fine Not sure why you set the framework to .NET Core 3.1 though, especially since earlier your target framework was set to .NET 8.0
flor
flor3mo ago
yes, i think its worked bro thank u alot ❤️
Angius
Angius3mo ago
Nice
flor
flor3mo ago
@ZZZZZZZZZZZZZZZZZZZZZZZZZ hey do u know how can i obfuscate my file 8.0 with only exe cant do that i have eaz
Angius
Angius3mo ago
$obfuscation
MODiX
MODiX3mo ago
"Then finally, there is that question of code privacy. This is a lost cause. There is no transformation that will keep a determined hacker from understanding your program. This turns out to be true for all programs in all languages, it is just more obviously true with JavaScript because it is delivered in source form. The privacy benefit provided by obfuscation is an illusion. If you don’t want people to see your programs, unplug your server." - Douglas Crockford https://softwareengineering.stackexchange.com/a/155133 * Spend your effort on putting proprietary things in your api, and keeping the distributed code as empty as possible * Use AuthN/AuthZ to control who/what/when/etc... * Free obfuscation is worth the amount your paid for it -- it's already broken and most decompilers out there can make sense of it. * Paid ofbuscation will bankrupt you unless you have a very strong revenue stream and can justify the additional cost with gained sales * The "threat" of someone hijacking your UI and shimming it to make it provide them money is not a real threat. If this is legitimate software, you can ruin their business with lawsuits - Cisien
Software Engineering Stack Exchange
Is it important to obfuscate C++ application code?
In the Java world, sometimes it seems to be a problem, but what about C++? Are there different solutions? I was thinking about the fact that someone can replace the C++ library of a specific OS wit...
flor
flor3mo ago
i have eaz and more i buy with money but with framework 8 it not works with the single exe not dll
Angius
Angius3mo ago
If you have some obfuscator thing, read it's documentation or ask it's support Nobody here has ever used tools like that, myself included So I have no idea how to use it