C
C#9mo ago
flor

i need help!

i start using .net core 8 and it use dll instead of exe commpile
79 Replies
Jimmacle
Jimmacle9mo ago
what type of project did you create?
flor
florOP9mo ago
No description
flor
florOP9mo ago
@jIMMACLE windows
Angius
Angius9mo ago
What type of project, though, as you were creating it Console? Windows Forms? Class Library?
flor
florOP9mo ago
windows forms
Jimmacle
Jimmacle9mo ago
so where are you not seeing an exe?
flor
florOP9mo ago
No description
Jimmacle
Jimmacle9mo ago
that is what it should look like
flor
florOP9mo ago
program.dll is the source code
Angius
Angius9mo ago
Well I see an exe there
flor
florOP9mo ago
dude i put the program.dll
Jimmacle
Jimmacle9mo ago
do you want $singlefile?
MODiX
MODiX9mo 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
florOP9mo ago
in dnspy
Jimmacle
Jimmacle9mo ago
yes, that is exactly what it should have
flor
florOP9mo ago
program.dll sourcecode
Angius
Angius9mo ago
And it showed you the decompiled source code, yeah So? That's what it does
Jimmacle
Jimmacle9mo 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
florOP9mo ago
i was using framework 4.8 i mean ok there can be dll
Jimmacle
Jimmacle9mo ago
which works differently
flor
florOP9mo ago
but the problem is it build as dll not exe
Jimmacle
Jimmacle9mo ago
and i'm trying to tell you that's not a problem that is how it's supposed to work
flor
florOP9mo ago
so what i have to do ?
Jimmacle
Jimmacle9mo ago
nothing
flor
florOP9mo ago
lol what
Jimmacle
Jimmacle9mo ago
there is nothing wrong you are misunderstanding what it should look like
flor
florOP9mo ago
how i can use obf then
Jimmacle
Jimmacle9mo ago
what is obf
flor
florOP9mo ago
obfuscate
Jimmacle
Jimmacle9mo ago
don't, because it's pointless
Angius
Angius9mo ago
$obfuscation
MODiX
MODiX9mo 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
Angius9mo ago
It's unlikely that your code is worth the license cost of the obfuscators that somehow work
flor
florOP9mo ago
okay can u change the dll name to different and exe name to differennt
Jimmacle
Jimmacle9mo ago
sure, change your project settings
flor
florOP9mo ago
if yes how where
flor
florOP9mo ago
No description
Angius
Angius9mo ago
That's a namespace setting visual studio dotnet change exe name in your search engine of choice is bound to have results
flor
florOP9mo 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
Angius9mo 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
florOP9mo ago
okay where do i change the dll name and exe
Angius
Angius9mo ago
Here, did the googling for you: https://stackoverflow.com/a/44188341/6042255
flor
florOP9mo ago
its not possible?
Angius
Angius9mo ago
It very much is possible
flor
florOP9mo ago
thannks alot to compile just exe
Angius
Angius9mo 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
MODiX9mo 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
florOP9mo 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
Angius9mo ago
No description
Angius
Angius9mo ago
No description
Angius
Angius9mo ago
This will show you the steps to do it with VS instead of the CLI
flor
florOP9mo ago
i dont have this section
Angius
Angius9mo ago
Did you try scrolling down on the page?
Angius
Angius9mo ago
flor
florOP9mo ago
sorry isee
flor
florOP9mo ago
No description
flor
florOP9mo ago
like this right,*
Angius
Angius9mo ago
If that's what the documentaton says, then yes Looks fine
flor
florOP9mo ago
No description
flor
florOP9mo ago
i just go folder right?
Angius
Angius9mo ago
Yes
flor
florOP9mo ago
No description
Angius
Angius9mo ago
Folder
flor
florOP9mo ago
No description
Angius
Angius9mo ago
Pick whatever location you want here, any random empty folder I like just builds\ but anything works
flor
florOP9mo ago
No description
flor
florOP9mo ago
i make same as u
Angius
Angius9mo ago
If you mean using builds\ then no, you didn't But this will work
flor
florOP9mo ago
i did the settings like this
flor
florOP9mo ago
No description
flor
florOP9mo ago
now? this one not gonna work?
Angius
Angius9mo 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
florOP9mo ago
yes, i think its worked bro thank u alot ❤️
Angius
Angius9mo ago
Nice
flor
florOP9mo ago
@ZZZZZZZZZZZZZZZZZZZZZZZZZ hey do u know how can i obfuscate my file 8.0 with only exe cant do that i have eaz
Angius
Angius9mo ago
$obfuscation
MODiX
MODiX9mo 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
florOP9mo ago
i have eaz and more i buy with money but with framework 8 it not works with the single exe not dll
Angius
Angius9mo 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
Want results from more Discord servers?
Add your server