Visual Studio project PublishProfiles location - asp.net-mvc

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?

Related

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

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 ?

Visual Studio 2019 Setup Project - Download prerequisites from the same location

I'm trying to create an installer using VS 2019 for a .NET Core 3.1 Console App.
It will be installed in a computer without internet and without the .NET Core 3.1 there.
I have added .NET Core Runtime 3.1.x as a Prerequisite in the Prerequisite Dialog.
When I build, its coming up with this error:
ERROR: To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'netcore3coreruntime_x64\dotnet-runtime-3.1.18-win-x64.exe' for item '.NET Core Runtime 3.1.18 (x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=616018.
The question is, in my development PC where should I put this file?
Place the installfile "dotnet-runtime-3.1.18-win-x64.exe" in directory "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\BootstrapperPackages\netcore3coreruntime_x64"
And check in the "product.xml" file in same directory, that the key "publickey" is not "0" and is set to "3082010a0282010100d0e4cf8fb3f5fb04dbafe41ff423aba80f08f43493a8d4aad542a3bb82045771c925c93ad62f8c4c4a18c8a2ed88b1b62717aef05f3540ab93a6e287be2dfcd20cece371bea6b34d20068d0e41aab04350628f227b36f0dff342357d6f4e2fbe8ab745a9736ceb1a1cdc1dd6fbba93ebbf1bd234d52fc4adec830ed84eddf5e35d2fa44a7cc9f04497f85df19cc0bf8ec30a02798f5ce6dbde6cd515591cda7a3288901553840a6e00c0ada5dbc8be60447524ee08a654c7e38bafcd7f6846724768cbd6cd9129a333f2e2334ed830ea6dc36ce3387b0163211353d615503e08723f127e67012bc2bcb9ae47fb7cab86dcf1747c408649412a7ed94ea6da574d0203010001"

Getting "object not set to an instance of an object" error while Publish project after updating Visual Studio 2019

Visual Studio throws error "object not set to an instance of an object" while Publish application with Folder Publish. Issue started after updating latest version of Visual Studio 2019
Resolution: Once 'Publish' is clicked FolderProfile.pubxml & FolderProfile.pubxml.user files will be created under PublishProfiles folder inside project folder. Move these files out from PublishProfiles folder to the Project folder. Close Visual Studio, load project solution again and publish. Now publish profile will be loaded by default. Folder publish profile

Stop Visual Studio 2019 from automatically adding files in project folder

I have a .NET Core 3 project in Visual Studio 2019. When I copy and paste a file, through Windows Explorer, into the project folder, Visual Studio automatically includes the file into my project, which I do not want to happen. Is there a setting to disable this feature?
Starting from VS 2017 project format in .NET has changed. You need to add <PropertyGroup> tag at the top of your .csproj file:
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
Here is the complete answer to your question:
In Visual Studio, why are all files automatically part of my C# project?
Well, you can modify the known project file (.csproj for c# project), by customize the items include path that satisfied your include files specifically.
For more details, you can check these out:
https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata?view=vs-2015&redirectedfrom=MSDN
Understanding a csproj assembly reference
Including content files in .csproj that are outside the project cone
Enjoy and deploy with confidence!

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