Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom framework targeting in Visual Studio 2010

I want to give developers using Visual Studio the ability to write programs against a custom framework that replaces .NET (similar to the Windows Phone and Silverlight frameworks, which are not subsets or profiles of an existing framework), and have full IntelliSense support and all.

Visual Studio 2010 supports multi-targeting, where you can target any framework (such as .NET, Silverlight, Robotics, XNA, Windows Phone and Mono) if you have the appropriate Targeting Packs installed.

I found that frameworks generally have some reference assemblies that they put in %programfiles%\Reference Assemblies\Microsoft\Framework along with a FrameworkList.xml file in the RedistList subfolder. I've tried just creating a new folder, putting my assemblies (e.g. MyFramework.dll) in there along with the RedistList subfolder containing a FrameworkList.xml file. I cleared the file but for one entry for similar to:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FileList Redist="MyFramework_1_0">
  <File AssemblyName="MyFramework" Version="1.0.0.0"
    PublicKeyToken="be3ea0d08db41157" Culture="neutral"
    ProcessorArchitecture="MSIL" InGAC="false" />
</FileList>

But Visual Studio doesn't list my framework in the list of available frameworks when creating a new project (after restarting VS). Obviously, I am missing something, but I haven't been able to figure out what.

How to create such a Targeting Pack that allows Visual Studio to see the custom framework, or something that has the same effect? What is generally included in a Targeting Pack? Can custom build steps be added?

like image 454
Daniel A.A. Pelsmaeker Avatar asked Nov 28 '11 11:11

Daniel A.A. Pelsmaeker


People also ask

What is the .NET framework for Visual Studio 2010?

The functionality of Visual Studio 2010, . NET Framework 4 and Silverlight 4 creates a powerful and unique combination, opening up new opportunities for developers to build applications that take advantage of new and existing devices, as well as emerging platforms like cloud services.”


1 Answers

I think Visual Studio first looks in the registry, notably in this key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework (or HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft.NETFramework on 64-bit systems)

You'll find a bunch of interesting subkeys, some of them actually pointing to the program files\referenced assemblies folders.

like image 72
Simon Mourier Avatar answered Oct 13 '22 00:10

Simon Mourier