how to change the dll reference file type assembly to active x - activex

I have one dll, its been referenced in two projects, in one project it shows as
In another project it shows as
Can anybody let me know why same dll shows different properties in visual studio ?
Because I m getting "cannot be used across assembly boundaries because it has a generic type argument that is an embedded interop type" error when i build the project which shows the reference as assembly.

Related

Why a lot of red lines in visual studio

I am trying to learn f# and copy some sample from internet. When copy to visual studio, it shows me a lot of red line as show in the following picture.
Some of your objects (like XName or XElement) are belonging to classes defined in the assembly System.Xml.Linq.dll.
The line open System.Xml.Linq is the C# equivalent line using System.Xml.Linq; that allows you to use the methods defined in the referenced assembly in your code.
If the assembly is not referenced (you didn't add the reference to System.Xml.Linq to the project), you have that error.
Remember that you can reference (as #Petr said), if you're using F# script files or F# interative, the assemblies you want using: #r "AssemblyNameHere". Other info about scripting and this option in this blog post.
Hover mouse over the red squiggles and a tooltip will popup. That tooltip explains what assembly you should reference.

Html TypeProvider MSBuild compilation issue

I am using multiple type providers two of them HTML type providers. Everything compiles using Visual Studio, however when using MSBuild one of the html type providers does not generate the type system and I will get errors such as:
FS0072: Lookup on object of indeterminate type based on information prior to
this program point. A type annotation may be needed prior to this program point to constrain the type of the object.
FS0039: The field, constructor or member 'Descendants' is not defined (while accessing the Descendants collection of the Html property).
Both of these errors are probably just caused by the fact that the type provider does not generate the types correctly when building with MsBuild.
Are there any parameters specific to Visual Studio/MsBuild which would affect type providers? It seems that this is linked to the HTML file itself, because as said it works with other files, but I don't see any reason why it works in VS and does not work using MsBuild.

F# Type Provider compiled as *.exe file

Why I cannot create Type Provider as *.exe file with [<TypeProviderAssembly()>] and [<EntryPoint>] inside?
When I try to reference such TP using #r #"d:\TP\bin\Debug\MyTypeProvider.exe", I see the following:
test.fsx(3,1): error FS3031: The type provider 'd:\TP\bin\Debug\MyTypeProvider.exe' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'MyTypeProvider' which cannot be loaded or doesn't exist. Could not load file or assembly 'file:///d:\TP\bin\Debug\MyTypeProvider.dll' or one of its dependencies. The system cannot find the file specified.
I need to have a type inference runtime in separate process, because it should be 64bit (unlike 32bit VS process). But I want to pack all things into one file, reference it from VS and start as external process.
Perhaps there's some good underlying reason for always looking for DLLs instead of EXEs, but I suspect this may be an arbitrary limitation.
I can get things to work in FSI if I supply the assembly's full name to the TypeProviderAssemblyAttribute constructor (e.g. [<TypeProviderAssembly("MyExe, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]), but IntelliSense doesn't work and I can't use the TP from other projects. Consider filing a bug with the team - but it would probably help if you could justify why you need an EXE instead of a DLL for your scenario.

How can I load an assembly dynamically?

I'm writing a Quick Watch for visual studio from scratch.
One part of this application is responsible for visualizing predefined visual studio debugger visualizer.
For implementing this functionality I use Microsoft.VisualStudio.DebuggerVisualizers assembly.
For loading predefined visualizers assembly I use System.Reflection.Assembly.LoadFrom("Specific Path").
Then for visualizing it I use VisualizerDevelopmentHost(objectToVisualize, visualizerType) method. But when I call ShowVisualizer method of VisualizerDevelopmentHost, the following exception catches :
Could not load file or assembly 'Visualizer asssembly' or one of its dependencies.
When I add reference to specified visualizer assembly statically its work.
How can I load visualizers assembly dynamically in this scenario.

Seq.generate_using is MIA

I'm trying to use the Seq.generate_using function but unfortunately, I don't seem to be able to find it. I thought it would be living here:
Microsoft.FSharp.Collections.Seq.generate_using
But it doesn't. I am getting the error listed below.
C:\Users\Owner\Documents\Visual Studio
2008\Projects\fsharp1\Program.fs(54,63):
error FS0039: The value, constructor,
namespace or type 'generate_using' is
not defined. A construct with this
name was found in
FSharp.PowerPack.dll, which contains
some modules and types that were
implicitly referenced in some previous
versions of F#. You may need to add an
explicit reference to this DLL in
order to compile this code.
According to the Sept 2008 CTP Release Notes:
The F# library is split into two
components. FSharp.Core.dll: Contains
the core F# libraries, which will be
stabilized and versioned infrequently.
FSharp.PowerPack.dll: Contains
additional useful F# libraries and
tools which will version more
frequently, and allow continued
innovation on top of the core F#
language and libraries.
Some methods in the Seq module were moved into the FSharp.PowerPack assembly, so you can only get those methods by doing the following:
If you're using Visual Studio, open your Solution Explorer, right-click on the project file, choose "Add Reference", and add "FSharp.PowerPack.dll".
If you're using a script file or fsi, then type #r "FSharp.PowerPack";; to load the assembly.
Now you should be able to call Seq.generate_using.
The #r "FSharp.PowerPack";; works for me but the addition of PowerPack to my solution does not. I am trying to use HashSet<>.

Resources