0

I have a WinForms application, everything works fine when I run it. If I publish with the built-in publish tool, it also works fine. The form is the size I want after installation. built-in publish

However, I want to use the Visual Studio Setup Project to create an installer for it. It can also install successfully, but the problem is that the form is a lot smaller compared to when I install it with the built-in publish tool or when I run it in Visual Studio.

I tried to add the manifest file and config file to the output, but it didn't help. The form is still very small and not the size I specified.

Maybe this is a dumb question but any help would be appreciated, thanks!

Update:

My project framework is .NET Framework 4.8.

I think this is a DPI awareness issue, but I have both the app.manifest and app.config file set up properly. Now the question is how do I make sure the Visual Studio Setup Project deploy my application using the settings I specified in the app.manifest and app.config files? I checked the installed files, there is a config file which is shown below.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
    </startup>
    <System.Windows.Forms.ApplicationConfigurationSection>
        <add key="DpiAwareness" value="PerMonitorV2" />
    </System.Windows.Forms.ApplicationConfigurationSection>
</configuration>

Then maybe it's a problem with the manifest file because I don't see a manifest file in the output folder? In project properties, I've selected app.manifest as my manifest file, but how do I add that to the Deployment project?

nebula
  • 1
  • 4
  • Could DPI be the issue here? Does it happen if you install on the machine you build it on? – stuartd Jun 09 '23 at 01:09
  • Are you running the ClickOnce and Windows Installer packages on the same machine? – jmcilhinney Jun 09 '23 at 01:17
  • Has the smaller size of your software affected by using Visual Studio Setup Project? What problem do you want to solve? – Jiale Xue - MSFT Jun 09 '23 at 03:15
  • @stuartd I installed it on the same machine that I built it on, and I thought maybe DPI is the issue so I included the manifest and config file to the output (application folder), but it's still showing a very small form. – nebula Jun 09 '23 at 07:25
  • @jmcilhinney yes same machine – nebula Jun 09 '23 at 07:25
  • @JialeXue-MSFT yes it only shows a smaller size when I run the application installed with the Visual Studio Setup Project. I want to make the application that's installed with the Visual Studio Setup Project the same size as the one ran with Visual Studio, which is the size I specified in the program. – nebula Jun 09 '23 at 07:28
  • So you mean the size of the window, not the size of the file? Would going straight to full screen help you? – Jiale Xue - MSFT Jun 09 '23 at 07:59
  • @JialeXue-MSFT yes size of the window. It's a form without frame, so there's no full screen option. – nebula Jun 09 '23 at 16:02

1 Answers1

0

Turns out it might be ClickOnce issue. Once I unchecked "Enable ClickOnce security settings" in the Security tab and rebuilt everything, the application looks exactly like I wanted it when I deployed with the Setup Project.

nebula
  • 1
  • 4
  • Hi nebula, Thanks for your sharing the solution of the issue. This will be a contribution for the community! You can [mark yourself answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235) to end this question. This will be helpful for others when they encountered similar issue and searching the solution. :) – Bowman Zhu-MSFT Jun 20 '23 at 07:44