C
C#5mo ago
jlim

How to deployment wpf app without internet

I wanna deploy my app. But it will be deploy without internet. So maybe click once this tool can't be used since this need internet if User download my app. Yea, my program's bin file contents is so many. So I don't want bin file content so a lot status. Is there any solution? I will deploy my app in to factory.
38 Replies
Angius
Angius5mo ago
You can just publish the project to a directory, no need for ClickOnce Assuming you're using a somewhat-recent version of .NET, you can even publish the whole project as a single .exe Could even include the runtime with it, so the target machine doesn't even need to install that
jlim
jlimOP5mo ago
Is there guideline? First of all , I used Msi before E . But after download my app , It is not execute
Angius
Angius5mo ago
Assuming you use VS, it's just what you pick in the publish wizard
jlim
jlimOP5mo ago
Visualstudio
Angius
Angius5mo ago
Then, yeah, just publish like normal and pick a folder
Angius
Angius5mo ago
Here, the folder option
No description
jlim
jlimOP5mo ago
I found it, I have 1 project and 2 library files. I try it! Its Result is that all files so a lot. It is the same bin folders contents
Angius
Angius5mo ago
What's it matter that there's a lot of files?
jlim
jlimOP5mo ago
Dll
Angius
Angius5mo ago
Yeah, but why does it matter?
jlim
jlimOP5mo ago
I mean dll files Not all files
jlim
jlimOP5mo ago
No description
jlim
jlimOP5mo ago
Like this
Angius
Angius5mo ago
Yes, again, I will repeat my question: why does it matter?
jlim
jlimOP5mo ago
Because i used nuget libraries using wpf
Angius
Angius5mo ago
That's the reason why you have those files, yes But why does it matter that you have them? Why is it a problem? Why would you like to not have many files?
jlim
jlimOP5mo ago
Yea problem is that mangement I will it input into other's program file But if I put into so many dll files, then it is problem if other developer see that view Short sentence: It is not clear I mean it is not clear if I put into dll files for execute my app where other file's location *other program's location Other program will be execute my app
Angius
Angius5mo ago
if you put the many file next to the exe file the exe file work not problem
jlim
jlimOP5mo ago
So my app must locate that other app execute location
Angius
Angius5mo ago
Aight, whatever, I'm just gonna take it at face value that you absolutely, positively, undisputably need a single file What .NET version does this project use?
jlim
jlimOP5mo ago
Yea of course. But I wanna clear environment
Angius
Angius5mo ago
Having multiple dlls in the same folder as the program is not dirty If it was, then call 99% of every program you have installed dirty Neither Visual Studio, nor Discord client, nor your browser, email client, or games, are a single .exe
jlim
jlimOP5mo ago
I used before clickonce, this is not showing dll files
Angius
Angius5mo ago
But you can't use ClickOnce now
jlim
jlimOP5mo ago
When I download app Yea Yea
Angius
Angius5mo ago
So you have two options: 1. Deal with the files 2. Tell me what .NET version you're using already and maybe you can publish as a single file
jlim
jlimOP5mo ago
.net8 I'm using it
Angius
Angius5mo ago
Aight, good $singlefile
MODiX
MODiX5mo 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
jlim
jlimOP5mo ago
Thanks I try it Buy If I have json file for configure, then have this method problem?
Angius
Angius5mo ago
What json file for configure?
jlim
jlimOP5mo ago
Configure Other apps location
Angius
Angius5mo ago
In any case, try it and see if it causes any issues
jlim
jlimOP5mo ago
Directory Path Yea I try it I tried but it is not execute So I tried deploy related to library file. But the result is the same. My app is didn't execute But I tried other simple c# program, in this case , I successed I found it, I tried it basic wpf app . It is successes. But I tried wpf app using WPF.UI this nuget package then it can't execute My app used that UI support nuget package
Angius
Angius5mo ago
Not sure why it would break in a self-contained build like that
jlim
jlimOP5mo ago
So maybe the reason why my original app can't execute, that Wpf.ui nuget package cause Ummm, I tried basic app they supporting
jlim
jlimOP5mo ago
No description
jlim
jlimOP5mo ago
Oh all dll deployment is OK, but single file is not ok I solved , I saw window event log. And hostservice in my app code it occurs error and didn't have error exception so I add exception code
Want results from more Discord servers?
Add your server