My 2015 Visual Studio Pro crashes every time I remove a reference from any C# project targeting .NET 4.0. Is there a fix for this?
Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01055
Addition and removal of references from the project file can also be done using any text editor and editing the .proj file. Each .proj file is an XML file storing the project configuration. Just remove the reference and save the file. (A possible work-around)
The problem you mentioned don't seem to be a general issue. Visual studio may also crash for some unknown host system or project configurations.
Related
After exporting a Unity project to Windows Phone, I am missing a reference in Visual Studio. The reference is Microsoft Visual C++ 2013 Runtime Package for Windows.
The files and dlls exist where they have to be but there I cannot add a reference to them in the reference manager because it does not exist there. Browsing and adding them directly also brings up a error saying the dll is not compatible.
Does anyone know how this reference can be fixed?
Thanks in advance
We had similar problem caused by "incorrect" version of used Visual Studio. Unity created a project for VS2015 which had reference for the newer version of the Microsoft Visual C++ 2013 Runtime Package. When we opened the project in VS 2013, a similar problem occurred. So the solution was to:
Open it in VS 2015.
Or change reference of the library to older version.
Or have more VS versions on the machine.
Hope this help
Many of my colleagues use Visual Studio 2010 and 2008, I use 2010, 2012 and 2008.
Has anyone found a good way to share assemblies and source code without having the reader having to convert the solution to whatever flavour of Visual Studio they are using?
(I realise that frameworks need to be installed etc.)
You can create multiple solutions for each per "Visual studio version". but make sure you have compatible target framework version in your projects.
If you are only distributing a single project file you can just leave out the solution file (.sln) and only include the project (.csproj) files. Visual studio will create it's own .sln file the first time the user saves the project after opening it.
If you have multiple assemblies you need included one thing you can do is have multiple .sln files (one for 2008 and one for 2010 and newer. 2010, 2012, and 2013 can all use the same .sln file) and have them point at the same .csproj files. Just create the solution in 2008 with all of its projects, then create a new empty solution in 2010 and add all of the existing projects to the 2010 solution.
EDIT: I just found out that some types of projects are not cross version compatible. If you run in to this just create a version spcific .csproj file too and have it point at the same source files (you will need to keep the projects in sync by hand if you change project settings or add/remove any new source files)
Generally, program your solution to the lowest possible .NET framework version... Sounds like 2.0 would be right up your alley. Do this because the older versions of Visual Studio do not support the newer frameworks.
If your code can all be written using one of the Express versions, then you and your colleagues should all get VS2013 Express. All of the Express versions are free, so there's little reason not to use the latest.
I've created a game for an assignment in Visual Studio 2012 and the university I'm at uses 2010 and it won't open! It mentions something about NET Framework 4.5. How can I convert my project so it will open in 2010?
It takes three step:
Step 1
Open solution file (.sln) in a text editor and change
Microsoft Visual Studio Solution File, Format Version 12.00
to
Microsoft Visual Studio Solution File, Format Version 11.00
Step 2
Open application configuration file (App.config) in a text editor and change
sku=".NETFramework,Version=v4.5"
to
sku=".NETFramework,Version=v4.0"
Step 3
Open project file (for C# language .csproj) in a text editor and change
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
to
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
Now enjoy your project in VS 2010 !
You may only need to open the project in Visual Studio 2012, and go to the project's properties page.
On the Application tab, locate the Target Framework setting, and change it to .Net Framework 4.
After that, you should be able to open it in Visual Studio 2010.
Also see Converting VS2012 Solution to VS2010, but so far I haven't had to do any conversions on VS2012-created projects to open them ins VS2010 - but YMMV.
[EDIT]
I just tested this again (to be sure) by creating a .Net 4.5 project in VS2012, and verified that I couldn't open it in VS2010. Then I opened it in VS2012 again and changed the framework version to .Net 4.0. After that I could open it in VS2010.
Note that I didn't have to make any other changes. However, this is on a computer with VS2010 and VS2012 installed, so it's possible that installing VS2012 might do something with VS2010 to make it work...
I have done this at work
Open .sln file with notepad
Change the two lines below
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
To
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
and hey presto the solution now opens in VS2010
You can create a new project in Visual Studio 2010 and then right click in the solution explorer > Add > Existing item. To pull through all of files in your 2012 project.
Either create a new solution in VS2010 and add all existing files from your VS2012 or compare the .sln file to a .sln file freshly created with VS2010. At the top you'll see some version information that should be changed. Also compare the .csproj files and change any version information accordingly and the target framework.
Missing library or framework could also cause this problem. For example, if you want to open a MVC4 or Silver Light project but you don't have these libraries installed at your PC.
Open .sln file and Change Format Version to 12.0 to 11.0
A while ago I created a Visual Studio Package/Add-In for Visual Studio 2010 (for those curious: http://visualstudiogallery.msdn.microsoft.com/ea23f9a7-a942-45b2-87e6-5df6ff0444ff). If I try to download that and install it in Visual Studio 2012, it doesn't work, I get a version error.
So my first thought was to see what happens if I try to port it to 2012. I downloaded and installed the VS2012 RC SDK, and basically recreated the whole thing in a separate solution and it all works. What I noticed was that many of the assemblies I had to reference (Microsoft.VisualStudio.*) were now version 11 as opposed to version 10 (for obvious reasons). After copying and pasting all the code over, I got it to work correctly in Visual Studio 2012.
My question now is this: Is it possible to have one .vsix file for multiple versions of Visual Studio (I'm guessing no.) If not, what's the correct approach to take as far as uploading the different versions? Can I upload two versions of a .vsix? Will the Add-In manager in visual studio pick the correct one automatically? Do I need to create a new package e.g. "Visual Pastie 2012"? Just looking for some guidance.
Rename the VSIX package to give it a ZIP extension and open it up. You'll find a file called extension.vsixmanifest. Inside this XML file you'll find an element called SupportedProducts which should look like the following to work in VS2012.
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>Pro</Edition>
</VisualStudio>
</SupportedProducts>
HTH
I wrote a visual c# 2008 windows form application ,then i edited the code in a computer which had visual studio 2010,but i can no longer run it in visual 2008,is there a way i can do this?
When you say "can no longer run it"... what happens?
the sln files are not compatible; you'll need different sln files for each VS version
the csproj are mostly compatible, although you might see a "version 4 not recognised, using 3.5 instead" warning or two, which is usually fine
the cs is compatible as long as you don't use dynamic or the other new language features
In most cases you can get away with just having a separate sln for VS2010. So just rename it to "Whatever_2010.sln", get your old "Whatever.sln" back from your source repository, and rename it to "Whatever_2008.sln".
http://stevedunns.blogspot.com/2010/02/tool-to-switch-project-files-between.html