I created a WCF service (the regular templete one) and tried to access the service. after that everything was fine. after i renamed (using refactoring the name of IService and Service) OSDataService and IOSDataService i got the following error while accessing the srv file :
how can i rename it without getting this error?
i tried also changing it in the web.config file and still the same problem.
Anybody had this problem?
You have to view the markup of the service file and change this in the directive to be the new name because it doesn't change automatically
Right click on the service name, then chose "view markup" and then change the "Class" attribute to be the new name.
Do you have a .svc-file? Have you updated the markup in that file if you have one?
Do a search in the whole solution after the old service name and you will moste likely find the file that need to be updated.
Well solved it:
you need first to rename the Iservice on the solution explorer, then refactor the service and refactor again all the data (VS2010 will tell you what to do) only then rename the service name (on the solution explorer)
You must update the reference in the client. Or update the stubs manually, but I wouldn't recommend that.
Related
I convert my huge website into web application. My application already have DateSelector.cs code file name, which is being used extensively in Project. Now Please tell me a way around that how can i stop on compilation the obj folder to not create DateSelector.resources file.
Have you tried doing a solution-wide search for "DateSelector.Resources" ? See if it turns up in one of the 'meta' files, it might just be listed twice.
Working on a system and need to update a WCF service. The issue I am having is that the service file is a .map file. Using Visual Studio I would have assumed that I could just right click it from solution explorer and update the service from there, but there is no such option.
The .map file itself is an xml containing the Service endpoints and what not. It is also grouped with (could be a plugin "VScommands" that did this grouping) a .cs file of the same name containing the auto-generated code to use the service.
I'm unsure what other information I should provide but if someone could point me in the right direction it would be much appreciated.
So to get around this issue I had to manually enter in the inforamtion I needed. Did this by using the svcutil.exe tool provided by microsoft.
Real late update, decided to just remove the entire service reference and re-add it.
I am having problems gaining access to a clients web service online.
If I have the wsdl file, can I do "something" in VS2010 with it so I can add it as a reference and start my C# coding?
Thanks Paul
When you go to "Add Service Reference", the textbox that allows you to enter a URL, can also take a path on your local filesystem to a wsdl.
Additionally, while not the optimal route, you can also use the wsdl.exe/svcutil.exe utility (bundled with VS) to generate a proxy class. Adding a reference is the better way to go, but this is an additional option.
Adding the Service Reference as a local path worked for me like a charm. I would have voted +1 for xelco52, but my rep is too low...
Only 1 issue; one of my members of the class I've added does not work. I wonder if I need to use the sledgehammer...?
If you have the WSDL file, under one of your projects in VS, right-click the References project folder and choose Add Service Reference. Click the Advanced button, and in the new dialog click Add Web Reference. Now, go find the WSDL file, either where you saved it or where you downloaded it, enter its location in the textbox, and click Go. VS will digest the WSDL and produce a class that is the service client, and others as necessary to implement custom types accepted by the service.
It's usually a good idea, if you have downloaded the WSDL, to include it as an item in the project that has the web reference; that allows it to be easily traversed as a reference source, and to be located should you need to recreate the web service classes.
I have changed my app name and namespaces as well from FooXXX to FooYYY.
VS applied changes to all files. I've checked all namespaces, names etc, project compiles but when I want to deploy it to emulator or to a device it crashes straight away. No warring, no message, no exception. Only spash screen is shown and then OS gets back to start screen.
I made a copy of this solution and I've changed all names, namspaces again and now app compiles and deploys, but I have two messages:
Message 2 Could not find schema information for the element 'http://schemas.microsoft.com/client/2007/deployment:Deployment.Parts'.
Message 1 Could not find schema information for the element 'http://schemas.microsoft.com/client/2007/deployment:Deployment'.
Any clue what casuses the crash?
Check the "Startup Object" in the project properties page. The sometimes requires manually being set/corrected when the namespace of the app is changed.
I had the same problem but it was due to the WCF RIA Services link.
In the project properties change the WCF RIA Services link to
Save and close the tab
Change to the previous link
Save
I got a problem like this and it was a problem inside WMAppManifest.xml file under Properties. Look at the TokenId, default page etc...
To resolve this, I actually just restarted VS2012.
I just wrote a new web part and now I am getting this error when I try to deploy them on my non-dev servers:
the default namespace
'http://schemas.microsoft.com/WebPart/v2'
is a reserved namespace for base Web
Part propertiees. Custom Web Part
properties require a unique namespace
(specified through an
XmlElementAttribute on the property ,
or an XmlRootAttribute on the class).
I am writing the web parts into CAB files and deploying them with this:
stsadm -o addwppack -filename web_part_name.CAB -url http://your_url_here -globalinstall -force
Everything works fine until I try to add the web part, then I get this error in a popup. It works just fine on my dev VM...?
Any ideas would be appreciate, thank you.
Well, it looks like your webpart definition file si somehow broken. The wey i do it is to put webpart into page and then export it. You can do this just by opening webpart galery, which can be located in site settings of root site collection and add your webpart there.
After that just place webpart to any page and use export button in webpart settings. This will produce .webpart or .dwp file depending on your webpart (.webpart is 'new' definition which is used by webparts native to MOSS 2007 and .dwp is for older webparts, but it depends how you have written your webpart)
Then just take exported file and include it into your project. This approach works for me at least.
Did you package your webpart as a .webpart file ?
If this is the case, you have to use the new v3 namespace. To use the v2, you have to package it as a .dwp file.
Yes, your web part definition file (*.dwp or *.webpart) is probably not correct. Post it here, and it should be swift to find the error.
A bit of a educated guess here but anyway :-
First check that you have XmlRoot attribute like this in your web part
[XmlRoot(Namespace = "Your.Namespace")]
public class YourWebPart: WebPart
{
...
and XmlElement attribute on your custom properties
[DefaultValue(0)]
[WebPartStorage(Storage.Shared)]
[Browsable(false)]
[XmlElement(ElementName = "YourProperty")]
public Int64 YourProperty
{
...
}
This error is happening when .NET is attempting to desterilize the data from the .DWP file and set the custom properties in your web part.
I suspect that the error may have nothing to do with namespace conflicts as SharePoint sometimes tends to fall back to an error messages that can be a red herring.
I would firstly examine your .dwp file. Do you have any custom properties set there, if so remove them and retest.
Comment out the custom properties in your web part code one by one and retest at each step.
I think you will find one of these is causing the problem - exactly why is the next question!