How can I work with XNA projects in Visual Studio 11 Beta? - visual-studio

Visual Studio 11 was released a few weeks back and now that ReSharper is available for it, I'm ready to start using it!
Some of the projects I'm working on are XNA projects. These don't appear to load in VS11 Beta, even after reinstalling XNA Game Studio 4 Refresh after installing VS11 Beta.
Has anyone got VS11 Beta working with XNA projects?

I have just gotten it to work, it required some hackery.
This will work after installing XNA Game Studio 4.0.
Find the Game Studio 4.0 directory in:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft
Copy the directory to:
%AppData%\Local\Microsoft\VisualStudio\11.0\Extensions
You can go there in Explorer by entering %AppDatain the address bar, hitting enter, and then navigating or filling out the rest of the address bar (for some reason just pasting the full relative url doesn't work)
Where %AppData% stands for your personal AppData directory. It is a hidden directory in your personal directory which is usually situated in C:\Users\YourUserName.
You are not done, open the directory you just created and open the extension.vsixmanifest file with a texteditor and change this block:
<SupportedProducts>
<VisualStudio Version="10.0">
<Edition>VSTS</Edition>
<Edition>VSTD</Edition>
<Edition>Pro</Edition>
<Edition>VCSExpress</Edition>
<Edition>VPDExpress</Edition>
</VisualStudio>
</SupportedProducts>
To this:
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>Ultimate</Edition>
<Edition>Premium</Edition>
<Edition>Pro</Edition>
</VisualStudio>
</SupportedProducts>
And save it. Now go up one directory level to the Extensions directory and remove any cache files that are present (don't worry they are automatically regenerated) and restart Visual Studio. You should now be able to open your XNA projects!
edit:
There is now a more popular up to date question here: How to install XNA game studio on Visual Studio 2012?
For me it did not work, the extension only showed up when I installed another extension (I updated nuget), removing caches did not seem to help at all.

Note that I haven't tried the beta yet. But I can give you some information that may be relevant.
Historically XNA Game Studio has always been tied to a particular version of Visual Studio. For example XNA 3 only works with VS 2008 and XNA 4 only works with VS 2010.
While you can reference the XNA assemblies in a project in another version of Visual Studio, you cannot use XNA Game Studio features - most notably the Content Pipeline. This means you must create your XNB files some other way, or not use ContentManager. Also the profile setting (HiDef vs Reach) must be set manually, and cross-platform project updating is not available.
I'm not really sure if projects will even load successfully or not; and if they do, whether they will build. If you open up an XNA project file in a text editor, you will notice some MSBuild instructions that the newer Visual Studio may not understand. If you clean out these manually, the project should load.

Related

Target Framework not installed when opening a Unity project with Visual Studio 2022

I am trying to open a C# solution that has been generated from a Unity v2020.3.19f project with Visual Studio 2022. Opening it with Visual Studio 2019 works just fine, but there are reasons I'd like to be able to open it with v2022 (such as GitHub Copilot). I did not have issues with this on my previous install of Windows 10.
Upon opening the solution in VS2022, I get the following pop-up prompt for every project in the solution:
Choosing the first option updates the target project to .NET Framework 4.8 and loads the project, but the whole file appears with red lines. When hovering over an underlined bool Property, the error shows as: `CS0518: Predefined type 'System.Boolean' is not defined or imported.
Choosing the second option opens this URL in my browser, prompting me to install .NET Framework 4.7.1 targeting pack (which was already installed via the Visual Studio Installer). When I try to install the .NET Framework 4.7.1 runtime, the installer responds with .NET Framework 4.7.1 or a later update is already installed on this computer. When I try to install the .NET Framework 4.7.1 Developer Pack, the installer allows me to choose from "Repair", "Uninstall", or "Cancel". Repairing has no effect.
I installed both versions of Visual Studio (2019 & 2022) the usual way through the Visual Studio Installer, along with the "Game Development with Unity" workload, which tells me it's installed all dependencies just fine:
Here's what I've tried so far:
Uninstall & reinstall all versions of Visual Studio through the Visual Studio Installer
Uninstall & reinstall Unity, with the Visual Studio module installed through Unity Hub (which just opens the Visual Studio Installer for me to choose which version I want to install)
Regenerate project files through the Unity Editor
Uninstall any references to .NET Framework through the Control Panel
Try reinstalling .NET Framework targeting pack 4.7.1 either from the Visual Studio Installer or manually through the Microsoft SDK website from the prompt
Nothing works for me. Any help on how to make VS2022 stop complaining is greatly appreciated.
Update 1: I found a couple of threads where people suggested simply pressing the Regenerate project files button in "Edit -> Preferences -> External Tools`. This has not helped me.
Update 2: I've tried everything I can possibly imagine, in different orders and different combinations. I even reinstalled Windows 10 to no avail. It's like Visual Studio just doesn't want to accept that the .NET Framework 4.7.1 targeting pack is installed. Please help :(
check this
https://learn.microsoft.com/en-us/answers/questions/733018/visual-studio-2022-cannot-locate-installed-net-fra.html
If you modified the value of ProgramFilesDir(x86), just to modify it back to C:\ProgramFiles(x86) can solve the problem
That is a very interesting problem, my main solution for you to first try is to make sure you are even targeting the correct .net framework in UNITY before you even build the solution. You are using the .NET 4.x, you need to go into your configuration settings and player settings in unity and ensure its not on a different version, for me, unity still defaults to .net standard 2.0. Follow the steps located here. To do so.
Another solution is to see if that first option actually gives you errors that prevent you from using unity, because I know that Visual Studio Code has problems occasionally where it tells me im wrong, my program is wrong, every life choice I have made was poor and I am poor, yet in unity, there are no errors showing in the console and I can hit play no problem. In that case I just had to rebuild a few times and fiddle with vs code until omnisharp stopped yelling at me.
Apperently I have been in a similar situation as when you were getting the error "Predefined type 'System.Object' is not defined or imported" because looking into it, I already have clicked on some of the links, try this one if that error persists. If you cannot prevent the errors to begin with, I would recommend you trying to fix the upgraded version from option one as that is more than likely going to get you the closest to a solution.

Cannot find UnityEngine.InputSystem

I am currently working on a new unity project and to be honest i am new at this.
I need to use the InputSystem package but Visual studio does not recognize it.
This is the version of my VS. Microsoft Visual Studio Community 2019 Version 16.9.3 and the version of Unity is 2020.2.1
As you can see by the picture, my VS already knows that I am working in a Unity project.
So the first thing that I tried doing is to regenerate project files but it didnt work. I also selected my VS as my default external script editor.
This is my external tools.
I re-installed VS using unity hub but nothing happend.
Do you have any suggestions? I followed some tutorials I saw over the internet but I am still getting no positive results and to be honest, I am getting out of ideas.
Just tested out the package installation. I installed the package in a fresh, empty Unity project. Here are the steps that I went through which worked in my case:
Locate the Input System package in the Package Manager
Click install
A warning prompt will appear, click yes
Unity Editor should now get re-launched on it's own, wait for that to happen
If Visual Studio is open, close it
Open Visual studio - right click on the Assets folder and select Open C# project
UnityEngine.InputSystem namespace should now be available, if not, re-open Visual Studio one more time
Let me know if it works for you.
For me works when I install .NET and .NET Core and reboot the computer. (made this on Windows)
https://dotnet.microsoft.com/en-us/download
https://dotnet.microsoft.com/en-us/download/dotnet/3.1

Microsoft Visual Studio shows a message "... stopped working ..." and restarts when I compile (build) a project

I am working with "Microsoft Visual Studio 2015 Community", under Windows10 X64, It was stable already for long time.
Recently, I installed C++ modules (Win32, CLR , ATL, ...etc.), and started creating new projects to work with those modules .. I created some new projects, one was DirectX 12 App .. during which the windows "Settings" -> "For developers" screen appeared .. I didnt know what to do with it, I canceled the project ..
Then whenever I try to build a new, even C# project or rebuild an existing project .. I get a screen with a message:
"Microsoft Visual Studio Stopped working and needs to restart"!
No new projects are building! I don't know how to restore it to stable!
Update
While searching around I found I can clear ComponentModelCache folder for VS, I tried it without success So I cleared the whole folder of Visual Studio application Data folder # (C:\Users\\AppData\Local\Microsoft\VisualStudio\xx.0)!! I don't know the sub sequences but now I can compile my projects!
You probably mist the windows setting 'for developers' like you described. You find the setting by searching with terms like 'for developers' in the start menu. Then enable the option. I'm not 100% sure if this will fix your problem, but this option needs to be enabled anyway.
Step 1
Step 2
I also recommend you to upgrade to Visual Studio 2017 Community.

Slow Cheetah stopped working in Visual Studio 2013

Suddenly, and inexplicably, Slow Cheetah has stopped working inside Visual Studio 2013. By "stopped working" I mean:
The context menus no longer appear (ie Preview Transform, Add
Transform)
Config file transforms no longer occur when the project is built.
By "suddenly" I mean yesterday it was working, and today it is not. I'm not aware of what changed on my computer that would cause Slow Cheetah to break
This happened for every solution on my machine (new or old). The problem seems to reside in Visual Studio itself.
There are many SO answers to this question, but all of them boil down to these 3 suggestions, which I tried:
Un-install and re-install the Slow Cheetah Nuget package using the Visual Studio library package manager.
Look in the *.csproj file and verify that the "PropertyGroup" section is above the "Import Project" element.
Delete %APPDATA%..\Local\Microsoft\MSBuild\SlowCheetah and rebuild.
Is there any way to debug this issue? Nothing appears in the build output window.
The fix was to go to this page and install the Slow Cheetah Visual Studio extension:
Slow Cheetah Extension
Odd, as Slow Cheetah worked on my machine for years installing it from the NuGet package; I never installed this extension.

How can I force Visual Studio 2010 to reload files and projects that have changed on disk?

I often use command line tools to do source control updates of files and projects that I have loaded into Visual Studio 2010. With previous releases when I did this I could force Visual Studio to notice and load the changes by doing a Save All. This doesn't seem to work in Visual Studio 2010.
I do have 'Detect when a file is changed outside the environment' checked in the Options window, but if I sit and wait it takes minutes or longer for the changes to be noticed.
How can I force 2010 to notice the changes in loaded source files and projects?
You can reforce reloading a project by unloading and loading the project.
Right-click the project and select Unload Project, then, when the project is unloaded right-click again and select Reload Project.
Note that this requires that all modified files in the project either be saved or the changes in the file be discarded.
It sounds like this could be the same problem that I experienced here. VS 2010 doesn't seem to pick up on file changes made outside the IDE (like if you add a file to the file system, and then click refresh in Visual Studio you don't see the new file, I experienced this on C++ projects).
You can refer here for the MS case, they claim they have fixed the problem in "the next VS release", which I assume would mean the first service pack for VS 2010.
Win7 shouldn't be a pre-requisite, though its possible an earlier edition (pre-SP1) of Visual Studio didn't work it. Upgrade always works, for reference the track changes option also needs to be turned on.

Resources