Web Service not defined. VB.NET - asp.net

Hi was wondering if anyone had come accross this problem before in where a web service was defined yesterday come to try today and its no longer defined.
Ive updated the web-reference folder no errors. The strange thing is when I type in the reference as in
DIM ws AS NEW service.serviseasmx()
What normally happens if VS would pick up on the service in the drop down could I have messed up my web.config file if so is it fixable or any other suggestions?
Thanks

Related

What is causing intermittent "Object reference not set to an instance of an object" at compile time in VS 2010?

I am sorry if this is not really a coding question (it depends on if its my code causing the problem I suppose).
I have seen this question: Tracking down intermittent 'Object reference not set to an instance of an object.' error on build
However, it has not been of much help (although if you read the comments, you will see that I thought it did help for a while there).
When I try publish my website, occasionally, I will get an error with no file or line reference:
Pre-compiling Web Site
Building directory '/App_Code/'.
Building directory '/'.: Publication (web): Object reference not set to an instance of an object.
Pre-compilation Complete
------ Skipped Publish: Project X:\, Configuration: Debug Any CPU ------
I know the usual causes of "Object reference not set to an instance of an object" but this seems a bit different, isn't it supposed to be a runtime error? Not a build error?
What is weird is that it happens, seemingly at random (about 25%-33% of the time). I can try to publish it and have it fail. Then try again straight after, without changing anything and it works fine.
I started getting this error after moving some of my functions (VB.net btw) to a new file in the App_Code folder so they can be accessed by all pages of the site.
If you need any more info, please let me know.
Thanks,
EDIT: After further investigation, it seems to only happen if I try to publish the website within a few seconds of saving changes to any file within it. What could cause this?
The same error occurred for me to, I deleted the dlls of the custom controls in the web site that are already in the bin, then i published the web site, and succeeded
IF you have any custom/usercontrols in your project, they are actually running at design time and can give object ref errors. This can occur during builds too. In that case, a property is being referenced that is NOTHING and throws the error.
I had a similar problem with a Windows Form project.
Wherever I try to move a custom control on the windows form, and then try to save the form, VS2010 comes back with "Object not set to an instance of an object".
I suspected the error was deep down in the layers of abstraction in my inherited code, but couldn't work out how deep to go, without reviewing every line of code.
My solution to this problem is this.
Open up another instance of Visual Studio 2010
Menu: Debug | Attach to Process..
Search for "devenv.exe xxx YourApplicationName..." and select it
Click "Attach"
Menu: Debug | Exceptions..
Tick all the boxes in the thrown column, then "OK"
Your second instance of VS2010 is not debugging your first instance, including all the custom controls.
Return to the first instance of VS2010, and repeat the actions that caused the error in the first place, the second instance of VS2010 will break at the line of code that has the error.
You may want to look at this link there is a bug in vs2012
https://connect.microsoft.com/VisualStudio/feedback/details/749901/error-when-i-click-publish-object-reference-not-set-to-an-instance-of-an-object

The type or namespace name 'IQueryable' could not be found

I have a weird issue. I have a VS 2010 .Net 4.0 Web Site (not web app) that runs on IIS 7.5.
When I build the site, I'm getting errors like the one in the title. Normally, this would be straightforward to fix - just add a reference.
In this case, I already have a reference to System.Core.Dll (4.0). I have "using System.Linq" declared.
If I fully quality my references to IQueryable (e.g. System.Linq.Iqueryable), autocomplete resolves it perfectly.
All my folders are read/write enabled.
I'm not sure what else to check.
Maybe one of my fellow Overflowers can help? :-)
TIA!
Ensure that the Target Framework is set to ".Net Framework 4" in the property pages
I found the error...it seems that there was an error in an upstream web.config that was causing my build to fail. I wish I knew why the symptoms manifested the way they did, but I'm building now. :-)
Thanks to all who answered and tried to help.

GetObjectContext returns nothing in VB6 COM dll, called from classic ASP

I am debugging this Active X dll using the VB6 IDE. I can see the execution get as far as an attempt to GetObjectContext. This method always returns NOTHING.
This is happening on Windows 7 32 bit, IIS 7. (The application is working in other locations, one of which is Windows Server 2008 with IIS 7)
I have Googled extensively and found many references to this relating to COM+, but there is NO COM+ involved in my scenario. Just plain old Server.CreateObject from a registered dll.
I have ASP code as follows
SET objCalendar = Server.CreateObject("SSYSDEV.Calendar")
objCalendar.BuildCalendar("ADMINUSERS")
SET objCalendar = Nothing
The problem lines of the requested function in the dll are:
Dim objHttpRequest As ASPTypeLibrary.Request
Set objHttpRequest = GetObjectContext.Item("Request")
Any help or suggestions, as always, will be greatly appreciated.
I'm still getting over the shock of having to work with VB6 - I never thought it would happen! It's like being dragged back to the dark ages, in a very rough fashion that's causing blisters!
P.S. I have also set up a COM+ component and had the ASP get the object that way, GetObjectContext returns an empty object in this case, which has no ASP objects in it. So this is no help :-(
I know this is a little late, but I had a similar problem and this solved it for me:
Thread: Problem accessing Request object via COM+
http://forums.iis.net/t/1146404.aspx
Summary: turn on 'Allow IIS Intrinsic Properties' in the COM+ component.
I've found that the COM+ approach to using VB6 components in IIS to be a bit flaky. I add this to a VB6 class that I want to instance in ASP::-
Private moScriptCtx As ScriptingContext
Public Sub OnStartPage(SC As ScriptingContext)
Set moScriptCtx = SC
End Sub
You can now access Request,Response,Server etc as properties of the moScriptCtx object.
You might be wondering how you call OnStartPage in the first place. You don't ASP automagically does that for you during the CreateObject execution.

using statement in asp.net web forms works locally but not live?

UPDATE : is there any iis 7 setting which might cause this issue? I recently moved to iis 7.0.
So I am having this weird issue where my code works locally but not when i deploy it live.
For example -
Employee e= new Employee();//does work locally
Employee e= new Employee(); // does not work live..says cannot convert Employee to MyLibrary.Model.Employee
MyLibrary.Model.Employee e= new MyLibrary.Model.Employee();////works live
So for some reason from the above code you can see it is not basically finding my using statements in the file.Although I have them it asks me to declares its full qualified name. Does anyone know what is happening?
The only time I have seen problems like this when dealing with ASP.net is when a stale assembly has been cached.
You probably don't have MyLibrary.Model.dll referenced in the live build.
Do you have two different assemblies referenced that both define an "Employee" object?
If so, you will need to fully qualify the objects.

silverlight error - the opreation is not supported for a relative uri

I've just started developing silverlight applications. I've created a webserivce in my asp.net project. Now, when I try to connect to it through my silverlight project I receive the following error:
"the opreation is not supported for a relative uri"
I am using the following url -->
http://192.168.1.2/MyWebsite/SubVersionedHistory.svc
I can find the class and its methods, but I receive this horrific error when I add it.
Thank you for your help and advice,
Vondiplo
I don't think you're alone in hitting this problem. I hit it today with VS2008SP1 + SL2 trying to create a Service Reference for an ADO.NET Data Service. First time I've hit the error.
Others have detailed similar experiences to reach this error:
http://silverlight.net/forums/t/87535.aspx
http://silverlight.net/forums/t/56629.aspx
It's not entirely clear at this point if the issue is with the IDE "Add Service Reference" dialog or something specific in the services causing this error. In my case, however, my code still worked despite the error message. I simply passed the URL to my service in the constructor of my DataService proxy client, like this:
var context = new DataServiceContext(new Uri("NorthwindDataService.svc", UriKind.Relative));
Summary point: Just because you hit this error in the IDE, your service reference may still work. Give it a try and let us know if you're seeing errors at run time.
Hope that helps.
[UPDATE] Based on some other advice I've found and tested, you can also try:
deleting your Service Reference
deleting your ServiceReferences.ClientConfig file
saving your solution
and then closing and reopening it in VS.
The simple act of closing and reopening your project has been shown to fix several problems with the Add Service wizard. Re-run the Add Service Ref wizard and you may have better luck. I personally tested this solution on a project today and can confirm it works. Hope that adds extra help to finding your solution.
You should be more specific about your problem. For example, are you having this problem when adding the reference or when you actually try to consume the service?
It sounds like you need to be using a full path, including the "http://" but that is just a shot in the dark based on the error message you provide.
[edit]If you are using the built in ASP.NET server instead of IIS then be sure you set a specific port number and use it in your path. For example, I have used http://localhost:4940/MyService.svc for testing[/edit]
Maybe this response can help you
You cannot use AbsolutePath, You need to use AbsoluteURL. Build your URL this way:
Uri url = new Uri(App.Current.Host.Source, "../settings.xml");client.DownloadStringAsync(url);
http://silverlight.net/forums/p/28912/95541.aspx
HTH
Braulio
Check the ServiceReferences.ClientConfig
if there are multiple endpoints there you will get this exception. one thing that can cause this is referencing a service using casini, later switiching to IIS express and rereferencing the service.

Resources