So I've just installed VS on a new machine & when creating a new project, none of the starting files are created. For instance when making an ASP.NET web app I just get left with a completely empty solution & when making a console app I get the starting code, but the project can't start because it's made outside of the solution... I guess...
I've tried reinstalling VS but no difference.
From the error message, I see that this issue appeared on .NET/.NET Core projects. So have you tried to create a project which is based on .NET Framework and see if it works for .NET Framework project?
“Error: The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json …”, it seems many causes for this error, but the key is unable to locate the .NET SDK.
So two mainly aspects: installation and path.
1). Navigate to C:\Program Files\dotnet\sdk and check if there lists different versions of SDK folders. Also type dotnet --list-sdks in CMD to make sure that all installed versions of dotnet SDK are listed. If there is no SDK listed, or some are missing, try to reinstall them.
2). Check the environment variable. Go to This PC(right-click) > Properties > Advanced system settings > Advanced > Environment Variables > System Variables > find Path > click Edit, and check if C:\Program Files\dotnet\ path is configured there. If not, try to add it and restart VS.
3). Other suggestions: try to install x86 version of SDK, repair Visual Studio, and refer to this similar thread: Visual Studio 2019 unable to locate .NET Core SDK.
Related
I'm currently trying to create a C# .NET 5.0 Console Application in Visual Studio 2019, and the option does not appear under project templates as I expect it to.
I downloaded Visual Studio Professional 2019 Version 16.9.4 (from https://visualstudio.microsoft.com/downloads/) and selected all workloads to be installed, then I installed SDK 5.0.202, ASP.NET Core Runtime 5.0.5, .NET Desktop Runtime 5.0.5, and .NET Runtime 5.0.5 (from https://dotnet.microsoft.com/download/dotnet/5.0).
When I go to File -> New -> Project and search for "Console Application", there is no default "Console Application" project template for C#. The closest I can find is "Console Application (.NET Framework)" for C#, VB, and F# and "Console Application" for C++. If I select "Console Application (.NET Framework)" for C#, the latest Framework that I can choose is ".NET Framework 4.8".
Actual Outcome: Project Templates
Actual Outcome: Frameworks
I compared notes with a developer who did not run into this problem, and they see the same framework restriction when they select "Console Application (.NET Framework)" for C#, but is also able to see the project template "Console Application" for C# (without ".NET Framework") and select ".NET 5.0 (Current)" as the target framework as expected. Nothing about what they installed and updated appeared to be noticeably different, our results for the command prompt command "dotnet --info" matched, and they did not have any "Installed products" listed under "About" or "Individual Components" listed under the installer that I was missing.
Expected Outcome: Project Templates
Expected Outcome: Frameworks
I have tried uninstalling and reinstalling everything, exhaustively installing every workload as well as additional individual components that looked potentially relevant, and making sure that the "Tools -> Options -> Environment -> Preview Features -> Show All .NET Core templates in the New project dialog (requires restart)" checkbox is checked.
Does anyone know what step I'm missing that is preventing me from creating a Console Application project template in C# using .NET 5.0?
Background -- This change/broke, issue that Microsoft opted deliberately you can read more here and the issue reported here but you can fix this with the 2 options listed below, i.e. A) enable it OR B) add it to VS via the repair tool
suggest clear VStudio Cache's -- kill dev process & clear cache before re/starting VS
run this cmd as admin in powershell
Get-Process devenv | Foreach-Object { $_.CloseMainWindow() | Out-Null }
Then DELETE ItemTemplatesCache, ProjectTemplatesCache folder ent. prof. etc.. C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE.
Now please Proceed with these Steps/Options
Option 1: you may have to enable this option...
Tools > Options > Preview Features > “Show all .NET Core templates in the New project dialog (requires restart)”.
Option 2: Install via Visual Studio Installer like so..
You can install missing workloads using the repair VS (this will also update the installer) and make sure you check the optional packages you want from the VS Installer tool please see this
after the installer starts check if the .NET Core workload is selected for desktop and console.. like below.. on the right pane you will need to check the correct boxes
Clear Visual Studio Component Cache (& optionally all Your templates)
Now, if you have already followed the above steps, then verifying you selected the checkbox of ".net-Desktop development" on top right is selected or not on Visual Studio installer: delete the cache and restore
i.e. you could restore the template in VS2017/2019 then try it again.
Kill dev process first run this Get-Process devenv | Foreach-Object { $_.CloseMainWindow() | Out-Null }
Please refer to the following steps:
DELETE the ItemTemplatesCache, ProjectTemplatesCache folder Ent. or Prof. version etc.. C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE. & C:\Users\<USERNAME>\AppData\Local\Microsoft\VisualStudio\16.0_93de0ddd
In the command prompt, navigate to the location of devenv.exe. This file is located in \Common7\IDE.
Type/Run this command devenv /installvstemplates and press Enter.
FYI - your templates cache is here, containing folders named after the zip files from your archives in the template folder.
you will need admin privilege's for edits/delete.
//templates cache Microsoft
%AppData%\Microsoft\VisualStudio\{some_version}\ItemTemplatesCache\
//templates path for verification, repair/reinstall or delete
%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates
%USERPROFILE%\Documents\Visual Studio 2019\Templates\ItemTemplates
%ProgramFiles(x86)%\Microsoft Visual Studio\2019\<edition>\Common7\IDE\ItemTemplates\
%ProgramFiles(x86)%\Microsoft Visual Studio\2019\<edition>\Common7\IDE\ProjectTemplates\
Option 3: debugging your env. Template Config folder
Checking/Diagnosing the version:
run this dotnet --version
install the correct core version https://dotnet.microsoft.com/download/dotnet/5.0 more here
this dotnet new -u will tell you which templates are installed, you can uninstall, clear the packages cache, restart and reinstall with the repair tool.
Download and run collect.exe - https://aka.ms/vscollect - and share the log file created in %TEMP%\vslogs.zip with MS on github
FYI - This is what your template folder structure in visual studio should look like.
└───mytemplate
│ console.cs
│ readme.txt
│
└───.template.config
template.json
Eventually clear the MEF component cache, manually or with this extension.
But most likely something is wrong in the user cache at C:\Users\USERNAME\AppData\Local\Microsoft\VisualStudio\16.0_93de0ddd, which includes in particular InstalledTemplates.json and privateregistry.bin.
Try and rename (or delete) the folder, (or one the the two mentionned files to narrow the problem down), while VS is off, and restart VS. Only make sure that you have the proper workloads installed and the .net 5 from VS.
While it can be hard to tell what's exactly the issue with VS or local environment you have, it should be possible to temporary create projects with dotnet cli:
dotnet new console --output <project-dir>
If you would want to add it to an existing solution run
dotnet sln <solution-name>.sln add <project-dir>
The console app project file is very simple, so you can even create it manually, or create a project from any existing template and replace the contents with following asa workaround:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
And maybe one more thing you could try is to run the VS installer as admin or ensure that it can install and access all the required components.
I checked and I am able to create dotnet5.0 console application with visual studio version 16.9.2 and SDK version 5.0.201. I think there is some installation conflict on your end. You can try uninstalling the SDK and reinstalling visual studio or updating it to latest version and downloading latest SDK. Also check if SDK is getting installed on your system under
C:\Program Files\dotnet\sdk[your SDK version]\
After a year of just dealing with it, I FINALLY FIGURED IT OUT.
Go to C:\Program Files\dotnet\templates then open every folder there. Apparently it was a permission issue because I was getting:
[Window Title]
6.0.6
[Main Instruction]
You don't currently have permission to access this folder.
[Content]
Click Continue to permanently get access to this folder.
[Continue] [Cancel]
After selecting Continue for each folder, everything started working.
The error that resulted from running dotnet new --list is what gave me the heads up.
My solution was deleting C:\Users\USERNAME.templateengine\
I have VS 2019 version 16.9.5 when I seen your post. I am using console app for my sample projects. I have tried it and able to achieve what you are looking for. I would recommend to update your VS to 16.9.5 and give it a try.
My VS 2019 version:
Creating Console app in VS 2019 16.9.5:
Finally it has created a console app project with target framework as .net 5.0
When I open my vs code program I get this message:
The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.
If I installed and even uninstalled the .NET core SDK and reinstalled it, there were several ways to change the external terminal to Power Shell, but no changes. Another problem I have when I click on the terminal is this message:
The terminal shell path "; C: \ Program Files \ dotnet" does not exist
If my .NET is on the same path and persists.
Please tell me how can I fix my problem?
Visual studio code : version 1.42.1(x64)
.NET core SDK : version 3.1.101(x64)
And I've tried these .NET core SDK versions:
version 3.0.100(x64) , version 2.2.207(x64)
Just simply close your VS Code app. It seems the error is produced because you are installing .NET Core SDK when your VS Code is opened.
After closing it, re-install the .NET Core SDK.
You must be able to use it now.
It worked for me.
I have the 5.0.103 [/snap/dotnet-sdk/112/sdk] installed (as shown, using snap) on KDE neon (based on Ubuntu 20.04).
In order to inform vs code where to find the .Net sdk, set a symbolic link '/usr/local/bin'(this folder is normally in your path):
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
After that, restart Visual Studio Code.
This worked for me.
I'm on a MAC (High Sierra), and closing VSC and reinstalling SDK did not help in my case.
VSC kept saying that SDK was "not installed or not on the path".
When I ran dotnet in the Terminal window I received "command not found" message.
I had to manually add /usr/local/share/dotnet to PATH in my ~/.bash_profile.
Correct path is displayed once SDK is installed (see picture below). I appended it to the PATH in my ~/.bash_profile, reopened Terminal, and it worked. You may have to reload VSC too.
Good luck!
DON'T DELETE ANYTHING BEFORE TRYING THIS!
To my fellow developers, I find a great and easy method!
1- Open VS Code and go to settings from the bottom left corner!
2- Type in #ext:ms-dotnettools.csharp to search dotnet tools!
3- Scroll down until you find "Omnisharp: Dotnet Path" and click Edit in settings.json link!
4- Go to the end of the file and right before } symbol type in "omnisharp.dotnetPath": "YOUR_DOTNET_LOCATION" enter your dotnet path.
note: don't forget to put a comma(,) before your line!
this will show vs code that you have a dotnet installed on your PC!
5- We are not done yet! Last but not least go back to settings and find Omnisharp: Use Modern Net Check the box and close your VS code, after reopening you will see that your VS Code detects dotnet!
Like this post if it worked out for you!!
One last thing! If your VS code detects it but still no snippets for C# you should check if you've set Omnisharp: Use Global Mono to always, if not then select always to enable it.
In my case it helped just to quit VSCode and re-open it (no need to re-install the .NET Core SDK) and the message you mentioned is gone.
Working on Mac M1. I was facing the same issue when I open the project in VSCode. This is how I resolved
Steps:
I quit my VS Code
I reinstalled dotnet SDK
I restarted my project
Initially, when I installed sdk, my VSCode was open, might be that was causing the issue.
I have the same problem,but my problem was cause by duplicate installation.
My solution as below:
1、open cmd, check the info of dotnet, I found it was a old version of 6.0.3,but I am sure I have installed a newest version of 7.0
input
dotnet --info
here is the output message
Host (useful for support):
Version: 6.0.3
Commit: c24d9a9c91
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.NETCore.App 6.0.3 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
2、check the path of dotnet,I found there is two different path of dotnet
where dotnet
C:\Program Files (x86)\dotnet\dotnet.exe
C:\Program Files\dotnet\dotnet.exe
3、go to the path I found,it’s clear that "C:\Program Files\dotnet" is the correct path of dotnet
C:\Program Files (x86)\dotnet
C:\Program Files\dotnet
4、edit environment variable,delete or move down the wrong path
environment variable
5、restart VScode,this error will not display anymore
it is not the way to solve this problem but you can do it to have your code run
you can open a command on that directory "; C: \ Program Files \ dotnet" then write this
dotnet run
and your code will automatically run
My issue was I was using .Net version 5 on Apple silicon, when I tried .Net 6 the problem got solved.
I have reinstalled SDK 6 via snap using https://learn.microsoft.com/ru-ru/dotnet/core/install/linux-snap.
Then, I have executed a command:
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
from https://github.com/dotnet/core/issues/7627
quit VS code. quit attached program (unity, etc). open originally attached program. Open VS code (assets > open c# project).
For those of you who are on macOS and on M1, and after they closed VS Code and re-installed it, still don't get rid of the error. Try this:
On VS Code, click "Open folder..." and open your user folder. For example my name is Bob and here is the path of my user folder: "Macintosh HD/Users/bob".
Once the user folder is opened, on the left browser panel of VS Code, open those hidden files:
.bash_profile
.zshrc
and at the end of those files, add this:
export PATH="/usr/local/share/dotnet:$PATH"
And save those 2 files.
Basically, it allows apps trying to find .NET SDK to find it in the folder "/usr/local/share/dotnet" which is the default installation folder on macOS Ventura 13.1 (and some previous versions I don't know lol).
To be honest, only one of these two files needs this new line but I'm to lazy to figure out which one.
Restart your Mac and it should work.
my solution to this issue is:
1-you must uninstall all of the services belong to Visual Studio(not Vs Code)
2-uninstall VS Code and folder "AppData\Local\Programs\Microsoft VS Code"
3-download new dotnet core SDK and install vs code
I hope it's done for you
I downloaded the Build tools for Visual Studios 2019 and that seemed to fix my issue on VS Code.
So go to this URL: https://visualstudio.microsoft.com/downloads/
All Downloads -> Tools for Visual Studio 2019 -> Build Tools for Visual Studio 2019
Then of course, download and run, then select "C++ Build tools" and ".NET desktop build tools" and install.
Worked for me, hopefully works for others too.
The same issue happened to me when I installed an extension. The reason was I didn't have .NET Core SDK installed. What I did to get rid of the issue was:
Close VS Code
Install .NET Core SDK
Re-install the extension (in my case)
Start VSCode from your terminal:
code pathToProject
For MacOS, Linux and Windows users alike.
From the Troubleshooting: 'The .NET Core SDK cannot be located.' errors wiki page in OmniSharp's VSCode repo:
If which dotnet produces a PATH, then the .NET SDK was able to successfully modify the PATH, but VS Code isn't picking it up. VS Code attempts to scrape the environment by launching the default shell under the covers. But this process can be fragile. You can attempt to work around this by starting VS Code from your Terminal.
You can try using homebrew
Install homebrew https://brew.sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Close Visual Studio Code
Run brew install --cask dotnet-sdk
If you will have error like this
Error: You have not agreed to the Xcode license. Please resolve this by running:
sudo xcodebuild -license accept
Then
Run sudo xcodebuild -license accept
Repeat brew install --cask dotnet-sdk
Basically my goal was to get dotnet commands working on terminal on VS code.
For that I spent an hour or two trying to find a solution. I came across a command "dotnet new console", and If i can execute it in the terminal of VS code I can get it to work. But it doesn't because it couldn't identify what dotnet was in the first place. The dotnet commands only worked on my base/usual cmd that comes with windows OS. So what I did was open my file in windows explorer that gives the error, open terminal in the same folder the project file is in (basically the folder that just popped up), and ran the script ("dotnet new console") without the quotes or brackets. It worked and I could use dotnet commands in the terminal of VS Code.
I have shown some arrows indicating files that weren't there before I ran the command. These files were added after running dotnet new console
Changing System Environment Variable Path from C:\Program Files (x86)\dotnet to C:\Program Files\dotnet fixed the problem for me.
If you are on Mac M1, make sure the package is ARM64. You choose if you want x64 or ARM64 when you download at the page, https://dotnet.microsoft.com/en-us/download/dotnet
This worked for me.
I also added the path to my .bash_profile file
You can find the .bash_profile file in your finder once you allow the showcase of hidden files.
This for future:-
hi Jeeva if you install again unity with vscode please read this
First install vscode extension https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp
If you got error like this "The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path" then install https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.300-windows-x64-installer
If vscode shows "The reference assemblies for .NETFramework,Version=v4.7.1 were not found" on output terminal then install developer pack https://dotnet.microsoft.com/en-us/download/dotnet-framework/net471 then try exit and open vs code if not work then restart
If you absolutely cannot get .NET Core SDK installed so that Omnisharp can find it, try unchecking the checkbox next to "Show Omnisharp Log On Error" under Settings > Extensions > C# Configuration > [] Show Omnisharp Log On Error
Click on the error that is shown on your VS Code
Get into Settings of the error
Download it and you are all set
Getting the following error 'The target "MainResourceGeneration" does not exist in the project' on Any project I try to build with Visual Studio. Cannot run debugger, cannot build/rebuild solution or projects.
Backing up a bit:
I had VS2012 and VS2017 (always used 2017) installed.
Got an error that pointed me to the Microsoft.Common.CurrentVersion.targets file. I mistakenly edited this file thinking it was part of my project.
Started getting the aforementioned build error on all my projects. Including simple, brand new, unaltered C# .NET framework console app.
Also had the same error on VS2012...
Tried VS2017 repair.
Tried VS2017 uninstall/reinstall.
Tried uninstall VS2017/2012, manually delete visual studio program files folders, reinstall 2017.
Still have the problem. Brand new fresh VS2017 install and not even a new console app will build.
Build output just shows this...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2789,7): error MSB4057: The target "MainResourcesGeneration" does not exist in the project.
Visual Studio Build Error: The target “MainResourceGeneration” does not exist in the project
Since this issue still occurs on a new console app, it seems that the Visual Studio installation file is corrupted. You can try to following steps to clean up the Visual Studio and reinstall it:
See if you have this file on your machine:
"%programfiles(x86)%\Microsoft Visual
Studio\Installer\resources\app\layout\InstallCleanup.exe"
Start an admin command prompt
Right-click on cmd.exe and select Run AsAdministrator
If so, please launch it from an admin command prompt with a -full
param
InstallCleanup.exe -full
If not, please manually delete the "%programfiles(x86)%\Microsoft
Visual Studio\Installer” folder
Verify that your initial install location for VS is removed. If it
is not, delete it manually.
Relaunch the newly downloaded vs_enterprise.exe (or
vs_professional.exe or vs_community.exe…)
Allow the first step to install the installer Once the installer
comes up and you can see workload choices (.net desktop and the
like), close it
Go launch the same InstallCleanup.exe to clean up old build of VS
Then relaunch vs_enterprise.exe and install VS
Please let me know if it works for you.
I tried several further steps like manually deleting Visual Studio related folders in my Users and ProgramData directories, and repairing .NET framework. None of those changes worked. Still had the same issue.
As a last resort I fully uninstalled .NET Framework (4.7.1) and grabbed the latest version (4.7.2) from https://www.microsoft.com/net/download/dotnet-framework-runtime. I no longer received the error and could then build my projects again.
I do not know or understand the root cause, but a full uninstall/reinstall of .NET framework fixed it...
In Visual Studio 2017, I am building Class Library(Portable) which targets both .Net 4.6 and Windows Universal Application 10.0. While building the application, below error is thrown.
Error File 'MakePri.exe' not found. See http://go.microsoft.com/fwlink/?LinkID=798187 for more information.
I have done the following
- Installed Latest Windows 10 SDK
- Repaired Visual Studio 2017
- Also in the environment variables, "WindowsSdkDir" is not available
- The path "C:\Program Files (x86)\Windows Kits\10\bin" exists and this file also available
I have used the following post to troubleshoot this issue.
https://social.msdn.microsoft.com/Forums/en-US/8c752e9e-85df-4fee-8026-9b54b6e46be2/vs1517-error-appx1639-missing-file-makepriexe?forum=msbuild
But still there is no luck.
I encountered same problem and after bugging me for a few days i finally managed to fix it. From build logs I saw that VS is not able to find makepri.exe file. In Microsoft.AppXPackage.Targets file variable MakePriExeFullPath is used, so I added new environment variable for my system with that name. For value, i pointed it to the makepri.exe in windows 10 SDK folder, which is on my machine in:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\MakePri.exe
I had the same issue and I tried everything except reinstall Windows:
Repair VS2017
Install additional SDK
Reinstall SDK
Uninstall VS2017, install SDK, then install VS2017
Uninstall and reinstall VS2017 (in one step)
As mentioned by original poster:
WindowsSdkDir environment variable does not exist
MakePri.exe exists in the right path
Registry entries for Win10 SDK exist in WOW6432 node and point to correct folder.
After a lot of hair pulling I fired up ProcMon (SysInternals) and run a build from VS. I noticed that MSBuild was looking for SDKManifest.xml in every SDK root folder, but that file did not exist in the Win10 SDK root folder.
I copied SDKManifest.xml from another PC with the same Win10 SDK version installed that did not have the issue and it worked.
It is beyond me why after uninstalling everything and installing from scratch, SDKManifest.xml was still missing.
PS: I have many SDKs installed (7.0 through 10.0) most of which were installed with the corresponding VS version. I run VS2008 (Pro), VS2013 (Ent), VS2015 (Ent) and VS2017 (Community) side by side for different projects (some projects, especially SSIS, cannot be migrated to VS2017 without an upgrade to the database engine version). I also have WDK installed for a printer driver development, so all this may be confusing the SDK/VS installer.
Edit: I would be reluctant to alter VS *.target files or add any environment variables and point them to a hard coded path. This will almost certainly break any future SDK installation and does not allow side by side usage of multiple SDK versions
I was having this same problem.
what I solved was I copy an SDKManifest.xml file from the folder of my sdk that was installed in this path "D: \ Windows Kits \ 10"
just copy the SDKmanifest to the project root folder, and it worked normally!
i am using VS 2010 and i am having trouble with clickonce deployment.
My goal is to Distribute application on DVD for users without internet connection to be able to install it. So it needs to include full installer of .NET framework 3.5 Client profile.
However, i am unable to achieve this.
From VS 2010 i choose publish wizard:
Specify location to publish this applicaton:
C:\ something\ something - this folder i will burn later to CD
How will users install application?
From CD{DVD
the application will check for updates from following location:
http://13874.w74.wedos.net/
And that is it, Publish wizard ends here.
So i create some aditional options:
Options->deployment
-Enable autorun for CDs
-Disable creation of publish.htm page
If i publish app, it is deployed to specified folder on my disk and can be installed from there.
But how do i include offline version of .net framework installer (I am Targeting .NET Framework 3.5)?
Thank you.
I managed to found solution for part of my question - how to include offline installer for .NET Framework 3.5. However, second part of my question - how to manage updates remains unanswered.
How to include .NET Framework offline installer for 3.5:
Under prerequisites (Properties->Publish->Prerequisites) make sure you have .Net framework 3.5 SP1 checked
Check radiobutton "Download from same location as my application" in lower part of prerequisities dialog.
Download .NET 3.5 full redistributable here http://go.microsoft.com/fwlink?LinkID=118080
Here comes the main part. It is not enough to just have .net redistributable on same location as your app, there is slightly more to do.
Unpack contents of installer from command line (command - "dotNetFx35.exe /x")
Choose directory to unpack via dialog shown.
Copy CONTENTS of subdirectory WCU\dotNetFramework to
a)x86 systems: %Program Files%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1
b)x64 systems: %ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1
In the same locations there should be xml file prduct.xml, edit it as folows:
A) Paste the following into the < PackageFiles > element:
B) Find the element for < PackageFile Name="dotNetFX30\XPSEPSC-x86-en-US.exe" and change the PublicKey value to: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001
C) Find the element for < PackageFile Name="dotNetFX30\XPSEPSC-amd64-en-US.exe" and change the PublicKey value to the same as in step above
Save the product.xml file
Thats it. Before that, when you attemp to publish it from visual studio it throws errors that it is unable to find variaus parts of .net 3.5 framework. Now it should work fine.
More information at:
http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm#General%20Issues
Section 2.3.1.1. - Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper package