How can get System.Runtime dll to deploy when i Publish from Visual Studio? - visual-studio-2019

I have a project that i am publishing using visual studio. The project includes a reference to System.Runtime.dll located in
Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades
But when i Publish , for some reason that dll is not deployed .
Does anyone have any ideas on this ?

Related

VS 2019 update to 16.8.4 broke every single one of my solutions

I don't recall the previous version I had (it could have been 16.8.1), but updating just now to 16.8.4 results in none of my solution projects being able to load. Here's the output window for one of my solutions:
F:\Users\username\Documents\Visual Studio Projects\FitnessManagerCore\FitnessManagerCore\FitnessManagerCore.csproj : error : The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.CSharp.CurrentVersion.targets
F:\Users\username\Documents\Visual Studio Projects\GeneralUtilities\GeneralUtilities\GeneralUtilities.csproj : error : The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.CSharp.CurrentVersion.targets
F:\Users\username\Documents\Visual Studio Projects\FitnessManagerCore\FitnessManagerConsole\FitnessManagerConsole.csproj : error : The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.CSharp.CurrentVersion.targets
VS advised to try to reload the projects manually. When I attempt this, I get the following error message:
It seems Microsoft has no means to roll back a previous installation. I do not have a restore point. I do not want to uninstall/reinstall.
Edit:
I just tried creating a new solution to see what would happen if I tried to load one of my existing projects. When creating a console app w/ .NET Core, I get this:
Update:
This latest VS 2019 simply does not want to work on my machine in any capacity. I uninstalled VS 2019, rebooted, and attempted to reinstall. The installation stops midway with the below error message. When I click "Report this problem", it opens a Microsoft web page to report the issue, but says "Disconnected from Visual Studio". Since I can't roll back to a previous version according to what I'm reading, I guess I just can't use VS 2019 anymore.
You could check in your csporj file if you have:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
You would need to change MSBuildToolsPath to MSBuildBinPath, like this:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
When you create a project in Visual Studio 2008, $(MSBuildToolsPath) is added by default to your csproj file as the path to Microsoft.Build.Engine v3.5.
Be sure to change it to $(MSBuildBinPath) which is the path to Microsoft.Build.Engine v2.0.
(more info here)

Running vs2017 DevEnv from command line with VS2017 Installer Projects

I have inherited a bunch of VS2010 (argh!) installer projects (.vdproj) that install some Win Services
Ofcourse in VS2017 those don't exist anymore but the extension 'VS2017 Installer Projects' works great. I can just open them fine and build, which produces the msi files.
However this needs to be done on the Jenkins machine (running Windows 7) as well. So I installed VS2017 on the Jenkins machine with the Project Installer extension and tried to first run the project from the IDE. Works great. Produces the .msi without problem.
Then I tried to run it from a command line:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
D:\ServiceInstaller\xxxServiceInstaller.vdproj /build
And it does NOT produce anything. Am I trying to do something that is not possible?
There are all kinds of long term solutions of course such as TopShelf, AdvancedInstaller, WIX etc with nice Jenkins plugins but for now it would be nice if I could make this work.
I've made following batch file to call with solution file parameter:
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe"
devenv /rebuild "Release|Win32" %1
Also make sure that in Visual Studio Configuration Manager Setup build is enabled.

Visual Studio project PublishProfiles location

PublishProfiles for Visual Studio project (*.pubxml files) are stored in Properties\PublishProfiles\ subfolder.
Is it possible to change default location of those files to some other like Settings\PublishProfiles and have Publish prompt read them properly?

ASP.Net Web Pages v2.0 missing. Where to find it?

I have an ASP.Net MVC3 Project which references System.Web.Helpers v2.0 and System.Web.WebPages v2.0 These both come with MVC4 and is part of razor2. However, my colleague doesn't have MVC4 installed, and doesn't have VS2012 installed, just vs2010 like myself. And his project compiles without the reference issue.
Visual Studio 2010 SP1 installed: Version 10.0.40219.1. SP1Rel
I recently installed Windows 8 on a new PC but our project requires vs2010 and can't run on vs2012.
This project was working fine on another PC which had vs2012 installed.
The new PC has:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0 but not:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0
but my colleague has the latter folder and the v2.0 assemblies - without MVC4, and without vs2012 installed. How is this possible?
Download it from here, use nuget console :
https://www.nuget.org/packages/Microsoft.AspNet.WebPages/2.0.30506.0
How is this possible? --
After a lot of hit and miss, I found out that my colleague has Microsoft WebMatrix. This product when installed happens to implement razor v2 and installs the mentioned assemblies in the directory:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0

How to install XNA game studio on Visual Studio 2012?

Is it possible to create XNA games using Visual Studio 2012?
Yes, it's possible with a bit of tweak. Unfortunately, you still have to have VS 2010 installed.
First, install XNA Game Studio 4.0. The easiest way is to install the Windows Phone SDK 7.1 which contains everything required.
Copy the XNA Game Extension from VS 10 to VS 11 by opening a command prompt 'as administrator' and executing the following (may vary if not x64 computer with defaults paths) :
xcopy /e "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\XNA Game Studio 4.0" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\XNA Game Studio 4.0"
Run notepad as administrator then open extension.vsixmanifest in the destination directory just created.
Upgrade the Supported product version to match the new version (or duplicate the whole VisualStudio element and change the Version attribute, as #brainslugs83 said in comments):
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>VSTS</Edition>
<Edition>VSTD</Edition>
<Edition>Pro</Edition>
<Edition>VCSExpress</Edition>
<Edition>VPDExpress</Edition>
</VisualStudio>
</SupportedProducts>
Don't forget to clear/delete your cache in %localappdata%\Microsoft\VisualStudio\12.0\Extensions.
You may have to run the command to tells Visual Studio that new extensions are available. If you see an 'access denied' message, try launching the console as an administrator.
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /setup
This has been tested for Windows Games, but not WP7 or Xbox games.
[Edit] According Jowsty, this works also for XBox 360 Games.
[Edit for Visual Studio 2013 & Windows 8.1] See here for documentation on installing Windows Phone SDK 7.1 on Windows 8.1. Use VS version number 12.0 in place of 11.0 for all of these steps, and they will still work correctly.
On codeplex was released new XNA Extension for Visual Studio 2012/2013. You can download it from: https://msxna.codeplex.com/releases
I found another issue, for some reason if the extensions are cached in the local AppData folder, the XNA extensions never get loaded.
You need to remove the files extensionSdks.en-US.cache and extensions.en-US.cache from the %LocalAppData%\Microsoft\VisualStudio\11.0\Extensions folder. These files are rebuilt the next time you launch
If you need access to the Visual Studio startup log to debug what's happening, run devenv.exe /log command from the C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE directory (assuming you are on a 64 bit machine). The log file generated is located here:
%AppData%\Microsoft\VisualStudio\11.0\ActivityLog.xml
There seems to be some confusion over how to get this set up for the Express version specifically. Using the Windows Desktop (WD) version of VS Express 2012, I followed the instructions in Steve B's and Rick Martin's answers with the modifications below.
In step 2 rather than copying to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\XNA Game Studio 4.0", copy to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\WDExpressExtensions\Microsoft\XNA Game Studio 4.0"
In step 4, after making the changes also add the line <Edition>WDExpress</Edition> (you should be able to see where it makes sense)
In step 5, replace devenv.exe with WDExpress.exe
In Rick Martin's step, replace "%LocalAppData%\Microsoft\VisualStudio\11.0\Extensions" with "%LocalAppData%\Microsoft\WDExpress\11.0\Extensions"
I haven't done a lot of work since then, but I did manage to create a new game project and it seems fine so far.

Resources