Displaying Version Information in a Web Service - vb.net

Can anyone suggest a way of getting version information into a Web Service? (VB.NET)
I would like to dynamically use the assembly version in the title or description, but the attributes require constants.
Is manually writing the version info as a string the only way of displaying the information on the .asmx page?

Yeah, attributes cannot have anything but constants in them, so you cannot use reflection to get the version number. The WebServiceAttribute class is sealed too, so you cannot inherit it and do what you want from there.
A solution might be to use some kind of placeholder text as the Name, and set up an MsBuild task to replace it with the version number when building the project.

You need to pick a type in your assembly and then do the following:
typeof(Some.Object.In.My.Assembly).Assembly.GetName().Version;

via reflection you can get the Assembly object which contains the assembly version.

Related

How can i get a list of modules

I have a WPF application built on top of PRISM.
When i tries to list module before loaded modules when find modules,I use dicitonary find module,but i dont look any module in modulecategory.
Any suggestions on how I can do this?
Thanks in advance
The easiest thing to do is to name your module assemblies in a special way, like MySomething.module.dll and then look for these when putting together the module catalog. There once was a module catalog implementation around on codeplex that allowed to pass a search pattern including subfolders... link

What DLL file do I need to add to my solution to use DbSet?

I am trying to use the generic DbSet class. I have tried adding the following references so far to my solution because the MSDN documentation states that DbSet lives inside System.Data.Entity:
However, as shown below I still cannot add a reference to System.Data.Entity, the only suggestion intellisense has is EntityClient which does not contain DbSet:
Resharper/Intellisense is not giving me any other suggestions of namespaces I could possibly add.
I have tried cleaning and rebuilding my solution, and I am using the .Net Framework 4 full version (not the client version).
I have tried using NuGet to search for EntityFramework and have found one result which I have added to no avail as is show below:
What DLL file do I need to add to my solution to add a reference to System.Data.Entity and use the DbSet class?
Thanks
The same MSDN reference page that you mention says that you need to reference EntityFramework.dll in your project.
Note that namespaces and assemblies are not the same thing. The following statement is a little over-simplified, but you can think of namespaces as residing inside (or becoming available by referencing) an assembly.
So, once you've referenced the assembly, you will still need the using System.Data.Entity; directive.

Mono(Touch): System.Xml.Schema.Extensions

I tried validating an XML file via the XDocument.Validate method defined in System.Xml.Schema.Extensions. However the compiler says that XDocument “does not contain a definition for ‘Validate’ and no extension method ‘Validate’ of type ‘System.Xml.Linq.XDocument’ could be found”.
Is the System.Xml.Schema.Extensions class really missing from MonoTouch? And if so, is there any other way to validate an XML read into a XDocument?
edit:
The class in question seems to be missing from Mono as well, according to their documentation. Is there any replacement?
MonoTouch is based on the Silverlight profile. Neither Silverlight nor WinPhone7 include System.Xml.Schema.Extensions.
Fortunately, Mono is open source, so you can take the code you need and add it to your project:
https://github.com/mono/mono/blob/master/mcs/class/System.Xml.Linq/System.Xml.Schema/Extensions.cs
Extensions appears to be new in 3.5 - MonoTouch is core 2.0, with bits of later versions (ie, LINQ) included.

Find child plug-ins of features in eclipse workspace

I want to find all the child plug-ins of a feature ? I know the name of the feature, but IWorkspaceRoot.getProject(String) does not really help me. I get an IProject that I don't know how to convert to a feature object (IFeature ?). Maybe I am on the wrong track and there is a better / easier way to do this. Any ideas ?
You could check that a selected IProject is a feature project by checking for the nature called org.eclipse.pde.FeatureNature.
Then you could try to use IProject.getAdapter(IFeature.class) call, the cast the result to IFeature. I did not try this with feature projects, but works well with Java projects.
The correct answer is the use of PDECore static class. This class provides a FeatureModelManager, that would provide the corresponding information:
FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager();
How to obtain this information? I looked with the plug-in spy to find which project defines the 'Deployable Features' export wizard (use Alt+Shift+F3 when the wizard is selected), and then looked at the implementation of the wizard class, where the addPages() method contains the previously described code block.

What is the preferred way to configure a mono application

When using VS, the preferred way to store user- and application settings seems to be to access VS "settings" tab for the given assembly and simply type the settings you need.
Monodevelop does not have this feature (or at least I did not find it...)
What is the preferred way to do this under mono using monodevelop?
If the answer is "well, do the same - but hand-type the code needed" I'd love some pointers to a nice tutorial.
On the mono list, John Ludlow had the answer I needed:
...First, the ConfigurationManager (
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx ) will expose two section handlers by default...
If you want more complex configuration option then you can define your own
handlers by inheriting from ConfigurationSection and ConfigurationElement.
See http://msdn.microsoft.com/en-us/library/system.configuration.configurationsection.aspx
and http://msdn.microsoft.com/en-us/library/system.configuration.configurationelement.aspx.
You may also need to provide a class inheriting from ConfigurationElementCollection
as well, if you want to be able to configure a collection of values.
Thanks to John and the people of the mono-list.
You still can use .settings files to keep settings, just edit them by-hand.
Also you can use App.config / another .config files