Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Hello @Cody Eidsness ,
Thanks for your question.
Since the UI option is missing in VB.NET, we do it manually by editing the project file directly.
- Generate a strong name key file by opening Developer Command Prompt for Visual Studio and run:
sn.exe -k MyAppKey.snk
This creates a file called MyAppKey.snk. Then copy this .snk file into your project folder.
- Edit
.vbproj
- In Visual Studio, right-click your project in Solution Explorer
- Click
Unload Project - Right-click again → Click
Edit .vbproj - Find the first
<PropertyGroup>section and add these two lines inside it:
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MyAppKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
- Save the file
- Right-click project -> click
Reload Project.
- Include the
.snkfile in your project.
- In Solution Explorer, click
Show All Filesbutton - Find
MyAppKey.snk - Right-click it →
Include in Project
Even with signing, .NET needs you to tell it to migrate old settings.
- Adding
NeedToUpgradesetting by:
- Go to Project -> Properties -> Settings
- Add a new setting:
- Name: NeedToUpgrade
- Type: Boolean
- Scope: User
- Value: True
- Call
Upgrade()on first run after update by opening yourApplicationEvents.vborForm1.vband adding this code:
If My.Settings.NeedToUpgrade Then
My.Settings.Upgrade()
My.Settings.NeedToUpgrade = False
My.Settings.Save()
End If
- Please republish with ClickOnce
For more information, you can refer to these documents:
- Sn.exe (Strong Name Tool)
- How to: Sign an assembly with a strong name
- ApplicationSettingsBase.Upgrade Method
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.