Today I met an error while trying to generate a Silverlight project from VS2010.
The error concerned a reference to a DLL file located on a remote computer.
The error message contained the following link : http://msdn.microsoft.com/en-us/library/ee890038(VS.100).aspx
The main content of the MSDN web page did not help me because my DLL file was already unblocked.
But I have got help from comments in the bottom of the page.
I needed to include the following tag into a VS2010 file named "devenv.exe.config" :
<runtime>
<loadFromRemoteSources enabled="true" /> <!-- The tag I have included. -->
...
I am wondering if there is way to enabled the loadFromRemoteSources variable via the VS2010 GUI.
I'm trying to fix a bug in VsClojure whereby Visual Studio does not recognize a file with the extension .cljproj as a Clojure project. This only happens when VS is not already open; in other words, if you open VS and then open a solution containing a Clojure project, it recognizes the project. But if you open the solution from Explorer or try to open the project itself from Explorer, it says "This project type is not recognized by Visual Studio."
My hunch is that whatever Visual Studio needs to load in order to recognize this project type is not loaded soon enough when opening the project from Explorer, but is loaded when Visual Studio is already up and running. My question, then, what is it that Visual Studio needs to load in order to recognize an extension's project type? And how do I tell Visual Studio to load it?
I've looked through MSDN's VSIX documentation for answers, but there is a ton of documentation to go through, and in what I looked at, I saw nothing pertaining to this question. I've also looked at IronPython's extension, but it seems to be structured completely differently from VsClojure's. Any help would be much appreciated.
You must add the project type to the registry so Visual Studio can recognize and load the *.cljproj file. See this MSDN article for details along with this article with all the steps involved when adding a new project type.
Unfortunately you can't make this changes from a VSIX, as MSDN states:
The VSIX format uses strictly file-based deployment and does not
support writing to the Global Assembly Cache (GAC), or to the system
registry.
Instead you will need to create an MSI installer. In that case pick your MSI creation method. IronPython uses Windows Installer XML (WiX) toolset so you can use that as your example. Here is a snippet from the WiX XML that sets up some of the registry for the project type:
<Component Id="Comp_PyProgRegistration" DiskId="1" Guid="A7BC75A8-F418-4133-8BF9-490A76E99108">
<RegistryValue Root='HKCR' Key='.pyproj' Type='string' Name='PerceivedType' Value='text' />
<RegistryValue Root='HKCR' Key='VisualStudio.Launcher.pyproj.10.0\DefaultIcon' Type='string' Value='[IpyToolsInstallDir]PythonProject.ico' />
<ProgId Id="VisualStudio.Launcher.pyproj.10.0" Description="IronPython Project">
<Extension Id="pyproj" ContentType="text/plain">
<Verb Id="OpenPyProj" Command="Open" TargetProperty="VSLAUNCHER" Argument=""%1""/>
</Extension>
</ProgId>
</Component>
Check out the Msi directory under in the IronPython source tree for the full example.
I want to deploy a Visual Studio package built using VS2005 deploy on VS2010. I am able to register the package(using regpkg.exe) and I am able to see it as a project template in VS2010. However, the package has a editor page which is displayed as soon as we select this project template which does not get displayed and instead it shows a default editor of VS2010.
I am not sure if this is a problem registering the package or a problem between Visual Studio versions. Can someone help?
We've seen this issue in attempting to launch the editor for existing projects that were originally created in VS2005. We have an editor that handles a specific extension (.svc). In VS2005, the .csproj had:
<ItemGroup>
<None Include="MyServices.svc">
<SubType>Designer</SubType>
</None>
</ItemGroup>
Removing the <SubType>Designer</SubType> allowed the expected behavior (double-clicking on the file opened the plug-in) rather than the default editor. Creating a new .svc file in VS2010 resulted in:
<ItemGroup>
<Content Include="MyServices.svc" />
</ItemGroup>
That always seems to work correctly.
Visual Studio drives me crazy and I am suspecting I am doing something wrong.
This is what I do: I installed Visual Studio (Pro '08) a long time ago, I installed the Windows SDK (Win 7 x64), someone emails me a project, it fails to build.
Invariably, it can not find windows.h. While it is easy enough to include C:\Program Files\Microsoft SDKs\Windows\v7.0\Include in the project settings of every single project, I feel that this may not be the proper way to do it. Is there a way to somehow make Visual Studio globally aware of these files?
I also tried to include the above directory in the path variable but that didn't change anything.
Also, it will randomly find windows.h but not winresrc.h in the same directory.
Edit:
It was a problem with my machine. Somehow, Visual Studio thought that my Windows SDK was in the wrong place. See accepted answer and comments for the fix.
#RichieHindle solution is now deprecated as of Visual Studio 2012. As the VS studio prompt now states:
VC++ Directories are now available as a user property sheet that is added by default to all projects.
To set an include path you now must right-click a project and go to:
Properties/VC++ Directories/General/Include Directories
Screenshot:
This answer only applies to ancient versions of Visual Studio - see the more recent answers for modern versions.
You can set Visual Studio's global include path here:
Tools / Options / Projects and Solutions / VC++ Directories / Include files
To resume the working solutions in VisualStudio 2013 and 2015 too:
Add an include-path to the current project only
In Solution Explorer (a palette-window of the VisualStudio-mainwindow), open the shortcut menu for the project and choose Properties, and then in the left pane of the Property Pages dialog box, expand Configuration Properties and select VC++ Directories.
Additional include- or lib-paths are specifyable there.
Its the what Stackunderflow and user1741137 say in the answers above.
Its the what Microsoft explains in MSDN too.
Add an include-path to every new project automatically
Its the question, what Jay Elston is asking in a comment above and what is a very obvious and burning question in my eyes, what seems to be nonanswered here yet.
There exist regular ways to do it in VisualStudio (see CurlyBrace.com), what in my experience are not working properly. In the sense, that it works only once, and thereafter, it is no more expandable and nomore removable.
The approach of Steve Wilkinson in another close related thread of StackOverflow, editing the Microsoft-Factory-XML-file in the ‘program files’ - directory is probably a risky hack, as it isnt expected by Microsoft to meet there something foreign. The effect is potentally unpredictable. Well, I like rather to judge it risky not much, but anyway the best way to make VisualStudio work incomprehensible at least for someone else.
The what is working fine compared to, is the editing the corresponding User-XML-file:
C:\Users\UserName\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props
or/and
C:\Users\UserName\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.x64.user.props
For example:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>C:\any-name\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\any-name\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup />
<ItemGroup />
</Project>
Where the directory ‘C:\any-name\include’ will get prepended to the present include-path and the directory ‘C:\any-name\lib’ to the library-path. Here, we can edit it ago in an extending and removing sense and remove it all, removing thewhole content of the tag .
Its the what makes VisualStudio itself, doing it in the regular way what CurlyBrace describes. As said, it isnt editable in the CurlyBrace-way thereafter nomore, but in the XML-editing-way it is.
For more insight, see Brian Tyler#MSDN-Blog 2009, what is admittedly not very fresh, but always the what Microsoft is linking to.
If you are only trying to change the include paths for a project and not for all solutions
then in Visual Studio 2008 do this:
Right-click on the name of the project in the Solution Navigator. From the popup menu select Properties. In the property pages dialog select Configuration Properties->C/C++/General. Click in the text box next to the "Additional Include Files" label and browse for the appropriate directory. Select OK.
What annoys me is that some of the answers to the original question asked do not apply to the version of Visual Studio that was mentioned.
To use Windows SDK successfully you need not only make include files available to your projects but also library files and executables (tools).
To set all these directories you should use WinSDK Configuration Tool.
This answer will be useful for those who use a non-standard IDE (i.e. Qt Creator).
There are at least two non-intrusive ways to pass additional include paths to Visual Studio's cl.exe via environment variables:
Set INCLUDE environment variable to ;-separated list of all include paths. It overrides all includes, inclusive standard library ones. Not recommended.
Set CL environment variable to the following value: /I C:\Lib\VulkanMemoryAllocator\src /I C:\Lib\gli /I C:\Lib\gli\external, where each argument of /I key is additional include path.
I successfully use the last one.
You need to make sure and have the following:
#include <windows.h>
and not this:
#include "windows.h"
If that's not the problem, then check RichieHindle's response.
I've got a project template which I want to appear under both "Visual C#" and its subtype "Test". I can get it to appear in one but not the other by placing it in
\Visual Studio 2008\Templates\ProjectTemplates\Visual C#
and
\Visual Studio 2008\Templates\ProjectTemplates\Visual C#\Test
respectively.
I've tried setting the following attributes in the vstemplate file
<ProjectType>CSharp</ProjectType>
<ProjectSubType>Test</ProjectSubType>
But it doesn't seem to work.
I've also looked at the default templates for ideas but can't find anything.
Is there a way of doing this without putting a copy in both locations?
Just found the NumberOfParentCategoriesToRollUp tag. By saying
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
It puts it in the parent as well (the template goes in the Test folder). The description claims it doesn't work for user templates but it works for me.