I've been copying some VS projects so that they each have a 2008 and a 2012 version project file (one with compiler version v90, one with v110). I need to give the copied projects (the 2012 ones -- the new ones) a new GUID. Thus far I've just had another VS2013 window open where I'm making dummy projects, unloading them, and copying their GUID to use in the new projects I'm making.
Is there a GUID generator or some better way than creating a new project in VS, unloading it, and then copying it's GUID and replacing it in the new project (that also has to be unloaded, which takes time when you have to do it a lot)?
VS comes with a GUID tool which you can find here:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\guidgen.exe
(Or similar based on your installation path)
Related
I'm translating a large application (solution with several projects containing about 100 forms) in Visual Studio 2012. I created a tool to export RESX files to XLS and create RESX from translated XLS. This app generates a RESX file and places it in the right place in the project folder tree. This is working as expected.
The problem I'm facing is I have to manually right-click every new RESX file and click "Include in project" ("Incluir en el proyecto", sorry I have VS in Spanish).
Is there any automated process that can do this?
In the interest of full disclosure, I'm the author of TranSolution, a commercial localization tool for Visual Studio (which does what you're asking and much more). It's not clear exactly how you want to do this, but maybe this is what you're after: https://msdn.microsoft.com/en-us/library/envdte.projectitems.aspx. See the "AddFromFile()" member for instance which my own product relies on but it's not trivial to set all this up though. Moreover, you need to consider updates as well (not just adds), and when doing so, other issues come into play, such as what happens if the ".resx" file is currently loaded in Visual Studio (if you're doing this in an active Visual Studio session you need to refresh it), what happens if it's currently checked out (in a source control package), etc.
I have a C# class library that references System.Data.SQLite (from nuget). This is the structure of my bin folder after build:
MyProject.dll
System.Data.SQLite.dll
x86/SQLite.Interop.dll
x64/SQLite.Interop.dll
System.Data.SQLite needs the SQLite.Interop to run and the correct dll is found at run time. However, when I generate a setup with InstallShield that includes the project primary output, the x86 and x64 folders are not copied and my application fails to run.
There is any way to force Visual Studio to include x86 and x64 folders in the primary output?
There is any way to include the folders manually in the InstallShield with relative path?
My environment:
Visual Studio 2012 Professional
Install Shield 2013 Limited Edition (Free)
System.Data.SQLite 1.0.96
Yes, there is a way to add/deploy folders through InstallShield. Under the Files tabs you can add the files/folder. While adding these files you can set relative path as well in this. Just set a property with the path and use that property in your relative path. So where do want to copy these files (reference locations for DLL), you can add that folder structure through InstallShield and you can add files in that.
I just ran across the same problem using VS2013 / Installshield LE; I ended up opting for changing the NuGet package on my machine to NOT create the x86 folder for the SQLite.interop.dll under the build folder.
To do that, look in the "packages\System.Data.SQLite.Core.1.0.104.0\build" folder under your project directory. Then pick the subfolder pertinent to the version of .NET you're targeting, and open the "System.Data.SQLite.Core.targets" file in a text editor. You'll want to delete all references to "%(RecursiveDir)" EXCEPT in the "SQLite Interop Library Content Items" section. Save, clean, and rebuild - the interop dll should now be in the same folder as the main executable/etc, and Installshield should be able to automatically include it as a dependency.
If it doesn't show up in the right place, try editing a different .NET version's .target file until you hit the right one.
PLEASE HELP!!!!
MY SET UP
Visual Studio Ultimate 2012 Update 4 on Windows 7 Professional,
ACTION
Installed latest SQL Server Data Tools Update
SYMPTOM 1 (Cannot create)
When attempting to create new project, I get:
Could not load file or assembly
'Microsoft.Data.Tools.Schema.Utilities.Sql.11, Version=11.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The System cannot find the file specified.
SYMPTOM 2 (Cannot open existing project)
When attempting to open an existing project, I get:
Unsupported
This version of Visual Studio does not have the following project
types installed or does not support them. You can still open these
projects in the version of Visual Studio in which they were originally
created.
Non-functional changes required
Visual Studio will automatically make non-functional changes to the
following projects in order to enable them to open in this version and
Visual Studio 2010 SP1. Project behavior will not be impacted.
WHAT I HAVE TRIED
I have uninstalled/reinstalled VS2012, SSDT, and Update 4.
I've gone through "Programs and Features" Control Panel and have Repaired everything in several different orders.
I have been all over the internet and have tried every single workaround from every article even remotely related to my situation, including deleting temporary files, registry keys, etc.
Nothing seems to work.
Please help me, I'm on day 2 of being dead in the water.
MICROSOFT -- HEADS UP!!!
This appears to have worked !!!!
Zip up the folder C:\Program Files (x86)\Microsoft SQL
Server\110\DAC\bin and set aside (in case this doesn't work for you)
Delete the contents of C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
Copy the entire contents of
C:\Program Files(x86)\Microsoft Visual Studio\11.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120
into C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
Re-launch VS2012,
AND
I was able to create a new SQL Server Database Project, and
I was able to open one of my existing projects.
VS did crash once when i was looking through my project using the SQL Server Object Explorer, but I have not been able to duplicate it.
How can I change the working director of Visual Studio C++ 2012. The default working directory is $(ProjectDir), every file I create in my codes are created in the project directory. What I want is that every file is created in the source code's directory, is that possible?
There is no convenient way to do it, but there are some workarounds.
One solution is to move project file to source directory.
Another solution is to add whole source directory to project (just drag'n'drop directory from windows explorer to project in solution explorer). Now, you can add items by right-clicking at source directory in solution explorer. They'll go to physical source folder. This surely works on Visual Studio 2013 RC, but I'm not quite sure about Visual Studio 2012.
One more solution, is to create Project Wizard or even Plugin. It's along story. Maybe, someone already done this, but I was unable to find.
I opened my vs2010 solution with vs2012 but it didn't make any conversion as from 2008 to 2010 was happening. So my solution still remains the same as 10 label on it. when I make a new solution of course it has 11 label on it. I haven't got any problem running like that but I am curious. Is there any difference? if yes, how to convert into vs2012 solution?
I managed to 'convert' the solution file to change the line containing '# Visual Studio 2010' to '# Visual Studio 2012' in the .SLN file.
Manual editing of the solution file is not necessary, or recommended. Simply open the VS2010 solution in VS2012, left-click the solution (at the very top of the Solution Explorer), then use File | Save As to overwrite the original file. This will effectively convert the VS2010 solution file to a VS2012 solution file.
There are some exceptions, but mostly you'll be able to open the same project and solution files files in both VS2012 and VS2010 SP1.
VS2012 may convert projects when you first open them, but the changes are (except noted in the document linked) backward compatible with VS2010 (ie using conditionals where needed to only apply to either version when loaded) Most project types will be left entirely untouched though.
It is about Visual Studio 2012 Compatibility
If you created your assets in Visual Studio 2010 with Service Pack 1 (SP1), many of them will load and run in Visual Studio 2012 without any further action on your part.
Many assets will also open again in Visual Studio 2010 with SP1 without any issues, even after you open those assets in Visual Studio 2012
For C++ projects it makes a difference, as the 2012 compiler (VC11) will only be used on projects that are explicitly 2012, not on 2010 projects opened in VS 2012. Some C++11 improvements are available with the VC11 compiler but not with VC10 (see this SO Answer for a summary), including:
Range based for-loops
New standard library headers (atomic, mutex, thread,...)
Smaller standard library container sizes
(And more to follow when the Nov 2012 CTP is delivered to VS 2012)
In order to convert from VS 2010 project to VS2012 there is no need to manually edit the solution file or 'Save As' over the existing project. Instead:
If you decline the update when first prompted, you can update the project later by opening the Project menu and choosing Update VC++ projects... [at the top of the menu options]
From MSDN's "How to: Upgrade Visual C++ Projects to Visual Studio 2012"
(This page was linked from #Joachim's MSDN link, but I wanted to have the answer here on SO since a number of other answers suggested manual workarounds instead of this VS 2012 feature)
In my case, I had some Visual Source Safe stuff (my project was created with Visual Studio 2003/2005, yes, very old!)
Once I manually removed the VSS stuff, the conversion succeeded.
PS: I know it's about VS2010, but maybe this helps others.
You can convert a project from VS2010 to VS2012 by doing the following:
Add the 2010 project to your VS2012 solution by right-click on your solution in the Solution Explorer and Select Add --> Existing Project...
The project will appear in the solution and will have (Visual Studio 2010) appended to its name.
Right-click on the added project and select Properties.
In the Configuration Properties --> General pane, change the setting in Platform Toolset field to Visual Studio 2012 (v110)
Repeat for each configuration type, e.g. Release and Debug.
I came across this question while googling for a solution to a specific problem: MSBuild was failing to execute the Publish target against a VS2012 solution that had started life in VS2010 when called from the command line (specifically through TeamCity):
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
MSBuild was looking for the Azure SDK 2.3 targets in the VS10 location (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets). The cause is explained by Sayed Ibrahim Hashimi in a blog post and, as I understood it, boils down to some decisions they made while enabling cross-version compatibility for solution files. The solution was simple: add the VisualStudioVersion property to the MSBuild invocation, something like this:
msbuild.exe MyAwesomeWeb.sln /p:VisualStudioVersion=11.0
Practically speaking, this overrides the following in each csproj file:
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Presumably you could get the same result by editing all of these by hand to replace 10.0 with 11.0 but that might break backwards-compatibility -- I haven't tried it. I also haven't tried an update to VS2013 to see if the problem persists.
So to wrap this up by answering the question: yes, there are some differences before you "convert" (using any of the methods offered by other answerers) and some differences remain afterwards.
This is slightly different, but along the same lines so in case it helps anyone:
I was loading a project where it looked like it was loading and then kept showing all projects as unavailable. No errors were on the migration report. I tried reloading the solution and projects many times, using various methods including suggestions here.
Finally I found a "Resolve Errors" option when right clicking on the solution in the Solution Explorer. VS went through a load process again and it worked; no problems.
I don't know what it did differently that time, but apparently it made a difference.
it's to simple just edit the .sol file
change the version to 11
like this
Microsoft Visual Studio Solution File, Format Version 12.00
Visual Studio 2012