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
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 thatIs there guideline?
First of all , I used Msi before
E . But after download my app , It is not execute
Assuming you use VS, it's just what you pick in the publish wizard
Visualstudio
Then, yeah, just publish like normal and pick a folder
Here, the folder option
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
What's it matter that there's a lot of files?
Dll
Yeah, but why does it matter?
I mean dll files Not all files
Like this
Yes, again, I will repeat my question: why does it matter?
Because i used nuget libraries using wpf
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?
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
if you put the many file next to the exe file the exe file work
not problem
So my app must locate that other app execute location
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?
Yea of course. But I wanna clear environment
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
I used before clickonce, this is not showing dll files
But you can't use ClickOnce now
When I download app
Yea
Yea
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
.net8
I'm using it
Aight, good
$singlefile
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: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
Thanks I try it
Buy If I have json file for configure, then have this method problem?
What json file for configure?
Configure Other apps location
In any case, try it and see if it causes any issues
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
Not sure why it would break in a self-contained build like that
So maybe the reason why my original app can't execute, that Wpf.ui nuget package cause
Ummm, I tried basic app they supporting
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