Can't add .wsdl in Visual Studio 2010 - visual-studio

Can't seem to add this web service in visual studio 2010 - what happens is :
C:\>wsdl [http://opensearch.addi.dk/1.0/opensearch.wsdl]
Error: Unable to import binding 'osSearchServiceSoapBinding' from namespace 'http://oss.dbc.dk/ns/opensearch_wsdl'.
- Unable to import operation 'search'.
- Group 'elementsAndRefinementsGroup' from targetNamespace='http://purl.org/dc/terms/' has invalid definition: Circular group reference.
I don't know much about this type of Web Services (use REST), but the guys that made this service use PHP and didn't see a problem or couldn't explain it to me.
I have look over the .xsd files but find them to verbose.
There is som PHP code in there but I do C# for the most part so I can't find heads or tails in them either.
Now the question is: How can I get this to work ? - if its not possible to fix so that I can import this in VS can someone show me how to do it manually in C#?

The wsdl from the opensearch is not very Visual Studio friendly. There is, as you mention, a circular reference in the schema. I am doing an .NET implementation of this for another library (AALBIB) - i downloaded all the .xsd files and manually edited the circular reference out, hoping that i will never use that part of the system. Then generated proxy classes using thewsdl tool

Related

How do I add an Apple class to a project in Visual Studio for Mac

I have a really tough question. How would I add a class in Visual Studio for Mac?
More specifically, how do I reference any class?
I'm going through the instructions here. It says there is an Audio Player example that uses the AVAudioPlayer class.
It doesn't specifically say how to add that class but going to the Projects > Add Reference menu and typing Audio in the search box shows nothing:
This is the instruction page I've referenced:
https://learn.microsoft.com/en-us/xamarin/mac/app-fundamentals/sounds
The page also says it's an example but I don't see any code only an API reference.
Apple APIs
https://developer.apple.com/documentation/avfaudio/avaudioplayer#see-also
https://developer.apple.com/documentation/avfaudio/avaudioengine
UPDATE:
I think I might have figured it out.
The class looks like it was in AVFoundation package not AVFAudio:
To use it you have to put:
using AVFoundation;
at the top of your class
Then in your code you can use:
var player = new AVAudioPlayer();
Or it looks like you can use the full namespace to create an instance:
var player = new AVFoundation.AVAudioPlayer();
I'm still getting errors so I don't know if that's it or not.
I also added some Nugen libraries like Xamarin.CommunityToolkit but I don't see them referenced in so I don't know if that's necessary.
Update 2:
It looks like the instructions for that are here:
https://learn.microsoft.com/en-us/visualstudio/mac/nuget-walkthrough?view=vsmac-2019
Here are the errors I'm getting:
/Applications/Visual
Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5):
Warning MSB3276: Found conflicts between different versions of the
same dependent assembly. Please set the "AutoGenerateBindingRedirects"
property to true in the project file. For more information, see
http://go.microsoft.com/fwlink/?LinkId=294190. (MSB3276) (project)
/Users/me/project/packages/Xamarin.CommunityToolkit.1.1.0/build/PreserveXamarinCommunityToolkit.cs(12,12):
Error CS0246: The type or namespace name 'PreserveToolkitAttribute'
could not be found (are you missing a using directive or an assembly
reference?) (CS0246) (project)
Side note:
There doesn't seem to be much activity here on SO, so I attempted to visit the Visual Studio forums and to post you have to join the Microsoft docs network. Here's some of the details when attempting to sign up. They didn't mention this before signing up.

Adding VBA reference in VB6.0

I have a old VB 6.0 application written by someone else. When i compile the application, it throws error on every line of code where VBA reference is required so fro e.g. it throws an error in the following lines:
Left$, Chr, Trim$
As soon as I prefix it with VBA.Left$, the error goes away. I was looking at the list of project References and saw only one missing reference called "Microsoft DTS run time 1.0". Where can I get this reference from and how can I add this in VB application. Also, is there any way, I can add VBA reference to VB application. I am running this VB application on XP machine.
any help will be appreciated.
Then you should install Microsoft DTS runtime:
How to: Install Support for Data Transformation Services Packages:
https://technet.microsoft.com/en-us/library/ms143755(v=sql.105).aspx
After, add the VBA reference (if is missing)
If you look at your list of Available References, you should see one for Visual Basic For Applications. Make sure this is checked and you will be good to go.
If there is more than one reference for VBA, select the one for msvbvm60.dll.

Create Language Service for VisualStudio 2010

I want to build a language service for visual studio 2010. I was first trying to follow the tutorial and documentations from MSDN.
The problem is i don't succeed to make this works (i'll explain later my problem). So i digged into existing implementations, i found Ook! and lua . both of these projects doesn't use the tutorial or documentation i found on MSDN, but something based on MEF. Lua used this only with previous Visual Studio versions.
So i'm wondering if i'm using an obsolete method to create a language service (But the documentation aims Visual Studio 2010), or there is different ways to do this, which depends on needs.
In my case, i've got a language that doesn't need to be compiled into cli, but i want to have an editor that have colorization, syntax warnings and errors, intellisense ...
The problem i mentionned is that when launching exp instance, there is no text editor with my file extension, and visual studio begins to have many lags. The language service is registered using 3 attributes : ProvideServiceAttribute, ProvideLanguageServiceAttribute and ProvideLanguageServiceExtension. Also initialized in Package intialize method, like mentionned in Proffer the Language.... The package is loaded when i try to open the file with my extension, the language service is initialized.
So i don't get it why i does not work, could you please help me to understand how language service works, and what is the best way to implement it
Thanks
Good chance your IScanner implementation has an endless loop, happened to me.

Custom tool warnings when using VS2010 service reference

I am trying to get going on using First Data's Global Gateway Web Service API. The first strange thing is that I need to download the wsdl and xsd files to my local machine. Then use the local machine's copy for the service reference. I haven't used many web services, so I figured that was okay.
After adding them and try to compile it I get the following errors:
Warning 1 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'AVSResponse' and namespace 'http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi'. Please check the XSD documents provided and try again.
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:portType[#name='FDGGWSApiOrder'] C:\Documents and Settings\user\my documents\visual studio 2010\Projects\sltnProcessCreditCard\ProcessCreditCard\Service References\ServiceReference\Reference.svcmap 1 1 ProcessCreditCard
Warning 2 Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[#targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:portType[#name='FDGGWSApiOrder']
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:binding[#name='FDGGWSApiOrderBinding'] C:\Documents and Settings\user\my documents\visual studio 2010\Projects\sltnProcessCreditCard\ProcessCreditCard\Service References\ServiceReference\Reference.svcmap 1 1 ProcessCreditCard
Warning 3 Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[#targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:binding[#name='FDGGWSApiOrderBinding']
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:service[#name='FDGGWSApiOrderService']/wsdl:port[#name='FDGGWSApiOrderPort'] C:\Documents and Settings\user\my documents\visual studio 2010\Projects\sltnProcessCreditCard\ProcessCreditCard\Service References\ServiceReference\Reference.svcmap 1 1 ProcessCreditCard
I tried the "Reuse types in referenced assemblies" mentioned in many places and that doesn't fix it. Has anyone come across this error? How did you fix it?
I found this answer that seems to at least let me continue working. In the mean time, I am open for other ideas.
Update: Quoting the answer for ease of finding it:
Try adding it as .NET 2.0 Web Reference.
Go to Add Service Reference, then click the "Advanced" button. Then you're given to option to add it as a .NET 2.0 Web Reference. I did this, and got it to work. I couldn't via the standard "Add Service Reference"

Building a Visual Studio Package based on another one

I want to add my own project type based on IronStudio. So,
I downloaded the source for and compiled the latest version of IronPython, then
I created a new Visual Studio Package.
I added the Templates\Projects\MyProject folders, and added a file to it, and set its property "Include in VSIX" to true.
Then modified the main Package class to be derived from IronStudio's PythonProjectPackage instead, and set the ProvideProjectFactory property:
[ProvideProjectFactory(
typeof(PythonProjectFactory),
"Django Project",
"Django Project Files (*.myproj);*.myproj",
"myproj", "myproj",
#"Templates\Projects\MyProject",
LanguageVsTemplate="MyProject")]
public sealed class MyPackage : PythonProjectPackage
And ran it. But MyProject isn't showing up in the project templates. Why not?
The generated .pkgdef file looks like this:
[$RootKey$\InstalledProducts\VSPackage3Package]
#="#110"
"Package"="{5cd7435c-7461-459f-80bc-c0c79e9d462f}"
"PID"="1.0"
"ProductDetails"="#112"
"LogoID"="#400"
[$RootKey$\Packages\{5cd7435c-7461-459f-80bc-c0c79e9d462f}]
#="Microsoft.VSPackage3.VSPackage3Package, VSPackage3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a4f1577d825253f8"
"InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL"
"Class"="Microsoft.VSPackage3.VSPackage3Package"
"CodeBase"="$PackageFolder$\VSPackage3.dll"
[$RootKey$\Editors\{888888c4-36f9-4453-90aa-29fa4d2e5706}]
"Package"="{5cd7435c-7461-459f-80bc-c0c79e9d462f}"
[$RootKey$\Editors\{888888c4-36f9-4453-90aa-29fa4d2e5706}\Extensions]
"py"=dword:00000020
[$RootKey$\Editors\{888888c4-36f9-4453-90aa-29fa4d2e5706}\LogicalViews]
"{7651a701-06e5-11d1-8ebd-00a0c90f26ea}"=""
[$RootKey$\Editors\{888888c4-36f9-4453-90aa-29fa4d2e5706}\LogicalViews]
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"=""
[$RootKey$\Editors\{888888c4-36f9-4453-90aa-29fa4d2e5706}\LogicalViews]
"{7651a703-06e5-11d1-8ebd-00a0c90f26ea}"=""
[$RootKey$\CLSID\{888888fd-3c4a-40da-aefb-5ac10f5e8b30}]
#="Microsoft.IronPythonTools.Project.PythonGeneralPropertyPage"
"InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL"
"Class"="Microsoft.IronPythonTools.Project.PythonGeneralPropertyPage"
"CodeBase"="$PackageFolder$\VSPackage3.dll"
"ThreadingModel"="Both"
[$RootKey$\Projects\{888888a0-9f3d-457c-b088-3a5042f75d52}]
#="PythonProjectFactory"
"DisplayName"="My Project"
"DisplayProjectFileExtensions"="My Project Files (*.myproj);*.myproj"
"Package"="{5cd7435c-7461-459f-80bc-c0c79e9d462f}"
"DefaultProjectExtension"="myproj"
"PossibleProjectExtensions"="myproj"
"ProjectTemplatesDir"="$PackageFolder$\Templates\Projects\MyProject"
"Language(VsTemplate)"="MyProject"
[$RootKey$\NewProjectTemplates\TemplateDirs\{5cd7435c-7461-459f-80bc-c0c79e9d462f}\/1]
#="My Project"
"SortPriority"=dword:00000064
"TemplatesDir"="$PackageFolder$\Templates\Projects\MyProject"
[$RootKey$\Projects\{888888a0-9f3d-457c-b088-3a5042f75d52}]
#="PythonProjectFactory"
"DisplayName"="IronPython"
"DisplayProjectFileExtensions"="IronPython Project Files (*.pyproj);*.pyproj"
"Package"="{5cd7435c-7461-459f-80bc-c0c79e9d462f}"
"DefaultProjectExtension"="pyproj"
"PossibleProjectExtensions"="pyproj"
"ProjectTemplatesDir"="$PackageFolder$\.\NullPath"
"Language(VsTemplate)"="IronPython"
[$RootKey$\NewProjectTemplates\TemplateDirs\{5cd7435c-7461-459f-80bc-c0c79e9d462f}\/1]
#="IronPython"
"SortPriority"=dword:00000064
"TemplatesDir"="$PackageFolder$\.\NullPath"
[$RootKey$\Services\{b98e41c4-581e-3532-beee-06829b683d39}]
#="{5cd7435c-7461-459f-80bc-c0c79e9d462f}"
"Name"="IPythonStarter"
I just want to get the bare bones up and running so I can start overriding some functionality (like the Add New Item dialog).
Update:
Reading my initial analysis once again increases my impression that some of the required components are missing (e.g. a dedicated ProjectFactory) and/or wired up incorrectly - from the MSDN documentation of the ProvideProjectFactoryAttribute Class:
ProvideProjectFactoryAttribute declares that a package provides a project factory.
And further:
If a VSPackage declares that it provides a project factory, it should create the factory and offer it to Visual Studio in the Initialize method of the Package-derived class.
You package is declaring to provide PythonProjectFactory, but (likely) doesn't offer it to VS, rather it is offered by the IronPython package. In turn you are providing arguments within the ProvideProjectFactory attribute list which PythonProjectFactory won't know about when asked for by VS.
Consequently you should at least provide a dedicated ProjectFactory yourself as per the walkthrough, wire up the classes accordingly and see how this turns out regarding the issues outlined below.
Initial analysis:
There appear to be several issues here at first sight - have you followed any tutorial on how to do this? In case, please note that some of those easily discoverable via search engines are outdated still. Either way I'd try working through and/or comparing your result with Walkthrough: Part 1 - Creating a Basic Project System from the MSDN documentation for VS 2010; please note that even this one is claimed to be outdated a bit according to the Community Content section on the bottom of the page.
Here is what I'd look into myself given the code you present, comparing with the walkthrough on the fly for more insights:
You realized already that the duplicate fragment starting with the GUID above PythonProjectFactory doesn't make sense - this is essentially trying to register two packages at once, which, even if allowed at all syntactically (which I doubt), can't possibly work like so due to both being registered with the same GUID [cross checking with the sample file in section Examining the Template Registration confirms this suspicion, as expected there is only one such fragment].
Please note that the GUID in question is the one identifying PythonProjectFactory (as per the respective source code), see below for more on this.
[Guid(PythonConstants.ProjectFactoryGuid)]
public class PythonProjectFactory : ProjectFactory {
Given .pkgdef is a generated file the next question is where this duplication/violation stems from. When two generated artifacts end up with the same GUID the respective definition in the sources is most likely messed up somehow, usually due to copy&paste duplication. Consequently you should verify whether {5cd7435c-7461-459f-80bc-c0c79e9d462f} is defined and referenced as intended, though here might be one or two other causes as well for this, see below.
A Package class needs to be identified by a GUID and the VS wizard generates some already in Guids.cs and references it accordingly on the class definition, however, the following is missing in your fragment [cross checking with the sample fragment in section To register the project template confirms this omission as well]:
[Guid(GuidList.guidMyPackagePkgString)]
public sealed class MyPackage : Package
Likewise it appears incorrect to derive MyPackage from PythonProjectPackage but reference PythonProjectFactory still rather than providing MyFactory as well (including a dedicated GUID), because the latter tells Visual Studio the location of your project template folder [see section Creating a Skeletal Project Factory]:
While it might well be possible to simply reuse all functionality from the base class PythonProjectFactory, inheriting is likely required simply because the factory must have a dedicated GUID too (as outlined in the walkthrough) in order to properly wire up the attribute specified data.
Likely unrelated, but still suspicious is that your two code blocks don't relate, as the Package class definition specifies Django Project Files (*.myproj);*.myproj, yet the result shows My Project Files (*.myproj);*.myproj.
Have you by chance mixed this from different builds or is this really a result of a clean one?
Good luck!
This stackoverflow posting might be helpful: VS2010: VSIX installation doesn't deploy item templates inside it
If this is not what you're looking for, try to see if you're missing something around the creation of custom project templates, I believe that's where the "missing link" is:
For VS 2008:
http://blogs.msdn.com/b/webdevelopertips/archive/2008/12/02/tip-32-did-you-know-how-to-easily-create-your-own-project-templates.aspx
For VS 2010:
http://blog.reybango.com/2010/09/21/how-to-create-html5-website-and-page-templates-for-visual-studio-2010/
and on MSDN:
http://msdn.microsoft.com/en-us/library/s365byhx.aspx
and here is how to create a project
template manually:
http://msdn.microsoft.com/en-us/library/ms185291.aspx
and here is how to create a new item template in VS 2010: http://msdn.microsoft.com/en-us/library/ms247113.aspx
Hope this helps
$PackageFolder$.\NullPath may have something to do with it.

Resources