Setup Project is adding built in .NET Framework .S

2020-07-16 13:10发布

I'm using VS Community 2015, with Setup Project extension. I've never seen this problem working with 2010. The problem is that when I add a project to the output, the Detected Dependencies list all dll's I've used in the project, including the built in ones:

enter image description here

After I run the installer, it then proceeds to install a hundred dll files, including files that should be part of .NET Framework, like:

  • System.IO.dll
  • System.Linq.dll

I made sure that:

  • I have all my projects set to .NET 4.5.2
  • inside Setup Project, I have the target .NET framework set to .NET 4.5.2
  • inside Setup Project, I have the Prerequisite set to .NET 4.5.2

What am I doing wrong? How can I get the setup to install only the dll's that are not part of .NET Framework (like Caliburn, or NLog). Thanks.

EDIT 1: As per 'Claudius' question, here's a list of .NET frameworks supposedly installed on my machine. Note that, I'm trying to install on the same machine I'm developing on. My /bin/Release folder doesn't have any of the .NET .System directories and the application runs fine from there. enter image description here

EDIT 2: Found another person with a similar problem. Sadly unsolved: Visual Studio Setup Project: Huge list of dependencies

2条回答
狗以群分
2楼-- · 2020-07-16 13:42

This might be a Visual Studio issue related to using project output. If you have, for example, just a handful of files that you want to install to the Application Folder, maybe some to the GAC, then just add those individual files to those locations in the File System on Target Machine view.

It might also be related to the CopyLocal setting, I'd make sure it isn't set for assemblies.

I'd also make sure that you haven't got that setting that causes Visual Studio's "Add Reference" to include assemblies from the GAC instead of the appropriate SDK assemblies.

查看更多
【Aperson】
3楼-- · 2020-07-16 13:52

If you select a dll (e.g. System.IO) which you are sure it's already in the .NET framework, you can set the property Exclude in the property window to True.

The dll will not be copied into the setup file.

查看更多
登录 后发表回答