WCF Service Reference - wcf

I created a WCF service that works perfectly when I go to http://localhost:52099/MyPagesWS.svc
Then I create a test MVC 4 project and add Service Reference with name ServiceReference1 to that url. When I click "Go" it finds my functions.
But when I try to call it in the code, ServiceReference1 cannot be called.
Do you have any idea what's going on?
I created a ConsoleApplication. That works.

I solved this. When you add the service reference, on advanced setting remove the "reuse types" checkbox.

Related

MVC 4 Areas not working properly

I have created a sample VB project in VS2010 to add Areas to the web UI but when I run it gives the following error:
The resource cannot be found. Description: HTTP 404. The resource you
are looking for (or one of its dependencies) could have been removed,
had its name changed, or is temporarily unavailable. Please review
the following URL and make sure that it is spelled correctly.
I also added AreaRegistration.RegisterAllAreas() to the global.asax file and also tried to manually register the route in the route.config but nothing is working.
routes.MapRoute( _
"Admin_default", _
"Admin/{controller}/{action}/{id}", _
New With {.action = "Index", .id = UrlParameter.Optional} _
)
It looks like it only finds the root views but not the Area specific view. Any ideas??
Found an answer on another site so posting the solution here:
The same project in C# works perfectly fine but fails in VB.
The reason: The controllers namespace is wrong in VB.net
Solution: Change the namespace of the controller in the vb project to MyApplication.Areas.MyArea.Controllers and then run it, will be fine.
Make sure you add AreaRegistration.RegisterAllAreas() as first line in Global.asax. Because areas should be registered before registering other routes.
Also in the route you mentioned, there is no default value for controller. So, make sure you provide controller value in url or provide default controller parameter in route.

navigationservice.navigate not available on the vs2013 project

I have two page application and the main page is default is "MainPage.xaml" and the second one is "AddPerson.xaml" when user click a button on main page I want the app to take user to "AddPerson" page.
And I wrote following for the Click event of the button
Me.Frame.Navigate(System.Type.GetType("AddPerson.xaml"))
and I am getting the following error
An exception of type 'System.NullReferenceException' occurred in MedicineSchedule.exe but was not handled in user code
Additional information: Object reference not set to an instance of an object.
If there is a handler for this exception, the program may be safely continued.
I tried other method of navigationservice.navigate which I cannot find the class in VS2013 express at all. The only method available is Me.Frame.Navigate in my project, please let me know how I can get this simple thing to work.
If it was .net 2.0 I would simple called new form with form.lod or something similar.
This doesn't work?
this.Frame.Navigate(typeof(AddPerson));
If you want/have to use a string take a look at the reply here:
convert string to type of page

VS 2010 to VS2012 and Project Name Change - Area forms HttpPost no longer working

I just created a new project in VS 2012 - basically replicated what I had in 2010 but changed all the namespaces to a different project name. All is working except my Area forms are no longer being directed to the HttpPost version of the action. Instead, the submit is redirecting to the HttpGet. Any ideas? My Areas appear to be registered correctly and no code has changed (other than namespace references).
Okay, I figured it out! Not sure why this didn't work, but for my other routes, I was using LowercaseRoutesMVC4 and didn't apply this to my Area routing. Not sure why this would break it, but it seems to be working now.

Checked use Core Data in new project

When I created my Xcode project i checked the checkbox "use Core Data" because I thought I was going to use that. Now however it turns out I never used Core Data and would like to disable it. My project is way to big to just simply create a new project and leave the checkbox unchecked.
Does anyone know what methodes and files I need to delete in order to have a project without Core Data? I think some project settings need to be changed as well.
Just create a new empty project and find out. Must of the methods will be in your App delegate. You also have to remove the Data model (.xcdatamodel) file from your project

Eclipse Plugin: Adding handlers programmatically vs. added via extension framework

I have in my Eclipse plugin some programmatically defined handlers (for instance cut/copy/paste) and some other editor related actions that are defined via the extension framework.
If I close the view of my plugin and reopen it the handlers defined via extension framework seems to break and when executed seems to use disposed gui elements. The programmatically one are readded in the createViewPart() Method and keep working.
I don't get how to reload the handlers defined via extension framework?
In handlers added through the extension framework, they are expected to get what then need to operate from the ExecutionEvent that's provided in the execute(*) method. org.eclipse.ui.handlers.HandlerUtil can extract most of the workbench related information for you.
Saving state in your handler between calls is not guaranteed to work, as the framework can dispose and recreate the handler as it needs to.