CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

Type is not resolved for member ... Having problems enabling debugging

rated by 0 users
This post has 14 Replies | 2 Followers

Top 10 Contributor
Posts 522
skagen00 Posted: Mon, Aug 14 2006 8:24 AM

I'm sure this is a no-brainer to some of you but I'm not exactly sure where to look and I'm just trying to get past this item quickly.

When I fire up the project from within Visual Studio, the URL is:

http://localhost:4268/<myproduct>/Login.aspx

The error I get is:

Server Error in '/<myproduct>' Application.

Type is not resolved for member 'MyCompany.CoreSystem.Library.ProPrincipal,MyCompany.CoreSystem.Library,

 

Now, if I omit the :4268, I can run it just fine. But I can't seem to hit my breakpoints in the debugger, which is a real problem.

Would anyone have a suggestion for me, please?

Top 500 Contributor
Posts 24

<Now, if I omit the :4268, I can run it just fine>

Your web server must be set up to listen on port 4268 instead of port 80.

< But I can't seem to hit my breakpoints in the debugger, which is a real problem>

You will not be able to debug server side code. Try testing locally first.

Chris Dearing Knoxville TN
Top 10 Contributor
Posts 3,716
Andy replied on Mon, Aug 14 2006 9:24 AM
Misled:
You will not be able to debug server side code. Try testing locally first.


Making sure things work locally (without dataportal remoting) is always a good idea, but if its a problem caused becaus of the remoting, you should know you can debug server side code.  You have to set the server up (ideally the remoting IIS host would be on your local workstation) to allow remote debugging, but it can be done.
Top 10 Contributor
Posts 522
skagen00 replied on Mon, Aug 14 2006 9:30 AM

The thing is, I'm not doing remoting yet... that's why I'm a little confused about the serialization error.

And thanks, Misled, though I'm not entirely sure where to configure this. I see in IIS admin there is a TCP port and HTTPS port 80 and 443 respectively... Could you give me a pointer as to where to look at this?

 

Top 10 Contributor
Posts 522
skagen00 replied on Mon, Aug 14 2006 9:59 AM

My stack trace is (if it helps):

[SerializationException: Type is not resolved for member 'MyCompany.CoreSystem.Library.ProPrincipal,MyCompany.CoreSystem.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.]
   Microsoft.VisualStudio.WebHost.Connection.get_LocalIP() +0
   Microsoft.VisualStudio.WebHost.Request.GetLocalAddress() +58
   Microsoft.VisualStudio.WebHost.Request.GetServerName() +27
   System.Web.HttpRequest.get_Url() +168
   System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +1389
   System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +49
   System.Web.UI.Control.PreRenderRecursiveInternal() +148
   System.Web.UI.Control.PreRenderRecursiveInternal() +233
   System.Web.UI.Control.PreRenderRecursiveInternal() +233
   System.Web.UI.Control.PreRenderRecursiveInternal() +233
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4436

Top 10 Contributor
Posts 3,716
Andy replied on Mon, Aug 14 2006 10:11 AM
Hmm.. if you're not using remoting, not sure why it would be serializing (although doesn't n-level undo serialize as well?).

So the Microsoft.VisualStudio.WebHost..I haven't seen that before, as you using Casini or IIS?  I think you can't use Csla with Casini..
Top 10 Contributor
Posts 3,716
Andy replied on Mon, Aug 14 2006 10:12 AM
That's exactly where you'd set the port.. change the http or https depending on how you setup remoting the url.
Top 10 Contributor
Posts 522
skagen00 replied on Mon, Aug 14 2006 10:18 AM

Thanks for taking the time to answer, Andy.

Rocky has a post on this in his blog...

http://www.lhotka.net/WeBlog/CommentView,guid,cfcaf6c4-63cf-4cf1-8361-ed3db07496a4.aspx

I tried to implement ISerializable on my custom Identity but that didn't alone do the trick. I'm going to try to implement it on my custom Principal (as it looks like one person needed to do this.) I sure hope it solves the problem - not having the debugger is a pain.

So it sounds like it's not likely a matter of changing the listening port and it has to do with this Cassini crap. :)

 

Top 10 Contributor
Posts 522
skagen00 replied on Mon, Aug 14 2006 10:31 AM

Thank goodness. OK, the solution posted in the blog works in terms of making both the custom identity and principal serializable (thus far, at least - I'm not sure what to instantiate in terms of GenericPrincipal as I don't know how to get a list of the roles for my custom principal, but I haven't built in really any authorization yet so I'll worry about that later).

I was pretty excited to hit my breakpoint :).

Thanks!

Chris

 

Top 10 Contributor
Posts 3,716
Andy replied on Mon, Aug 14 2006 10:37 AM
So it was Cassinin that was causing seralization.

Glad you got it working... I am hopefully going to be doing asp.net 2 pages soon, and Cassini is likely what i'd be running under (that's how you test file based websites, right?).

Wonder what happens with Integreated security though... I guess it handles this in a special case?
Top 10 Contributor
Posts 492
Andy, you can choose what to use in the project's properties, so you can use a custom location for debugging. You just need to create the virtual folder in iis.
Top 10 Contributor
Posts 3,716
Andy replied on Mon, Aug 14 2006 1:19 PM
Ahh, that's a relief.
Top 10 Contributor
Posts 522
skagen00 replied on Mon, Aug 14 2006 1:27 PM

So I just read Xal's message, and changed the base url of the custom server to be the virtual folder in my IIS - disabled the ISerializable interface implementation (as suggested in a reply to Rocky's blog), and everything works swell.

Thanks Xal.

Not Ranked
Posts 11
sydneyos replied on Thu, Sep 14 2006 9:47 AM

For those of us who are still having this problem, could you say more about the solution?  I don't know what you mean by "changed the base url of the custom server..." or disabling the ISerializable interface.  Do you mean that you had made your custom principal inherit from ISerializable before and then removed that? 

Right now, my custom principal just has the [Serializable] attribute.  I assume I should keep that . . .

Thanks

Top 10 Contributor
Posts 522
skagen00 replied on Thu, Sep 14 2006 11:59 AM

Hiya -

Yes, I was talking just about the ISerializable interface implementation - I found I didn't need to do that. My principal and identity are still marked as [Serializable()] though, of course.

I'm not sure how much this is going to help you as I made a copy of my application so that I would freeze "what I had" for a demonstration, but I noticed I didn't need to do a thing in my new web application.

On my old one, if i go into the properties of the web site (from VS 2005) and go to the start options, and look in the Server section, I am not using the default web server - I am instead selecting use custom server, and then on my base url I have: http://localhost/<myapp>/ 

Let me know if you get that solution (or another to work). Thanks!

 

 

Page 1 of 1 (15 items) | RSS

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems