Skip to main content

Microsoft Silverlight

Unanswered Question Bug in DomainService class created in XAMLRSS Feed

(1)

enantiomer2000
enantiom...

Member

Member

39 points

59 Posts

Bug in DomainService class created in XAML

 I posted this in the Silverlight 3 forum, but now think it is really an RIA issue:

There is an exception that is thrown when I try to add my DomainService class in XAML.  Visual studio gives me an error that says "AG_E_UNKNOWN_ERROR".  If I open the project in expression blend 3 it says "Cannot create an instance of 'CompanyManager'" and the inner exception says "Object reference not set to an instance of an object".  The stack trace is CompanyManager->HttpDomainClient(Uri service)->HttpDomainClient(Uri service, bool useSSL)->HttpDomainClient.ComposeAbsoluteServiceUri.  When I actually run the project everything runs just fine but the Designer won't show me anything.  I have tried this on both XP and Vista with Linq2Sql and Entities with the same result.  I installed everything that the MS page recommends:

 http://silverlight.net/getstarted/silverlight3/default.aspx

the RIA Services example from MS also has the same problem on my computers.

http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=2387

if I disassemble the generated DomainContext class I get this in the constructor that is failing:

 // Methods
public MyDomainContext() : base(new HttpDomainClient(new Uri("DataService.axd/SilverlightRIA-Web-MyDomainService/", UriKind.Relative)))
{
}
where the ComposeAbsoluteServiceUri has the following code:
[Conditional("SILVERLIGHT")]
private void ComposeAbsoluteServiceUri()
{
if (!this._serviceUri.IsAbsoluteUri)
{
if (Application.Current == null)
{
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.DomainClient_ApplicationNotInitialized, new object[0]));
}
string absoluteUri = Application.Current.Host.Source.AbsoluteUri;
if (this._usesSsl && absoluteUri.StartsWith("http:", StringComparison.OrdinalIgnoreCase))
{
absoluteUri = "https:" + absoluteUri.Remove(0, "http:".Length);
}
this._serviceUri = new Uri(new Uri(absoluteUri), this._serviceUri);
}
}
We know that Application.Current is not null, I know that the _serviceUri has been set since it is passed in explicitly.  'Host' or 'Source' could be null.  This probably looks like the most probable bug.  It might actually make sense since when the designer tries to instantiate this, the Application may not have been fully constructed?

Hopefully this bug is fixed fast...

<ria:DomainDataSource x:Name="dds" AutoLoad="True" LoadMethodName="LoadCompanies" >
            <ria:DomainDataSource.DomainContext>
                <local:CompanyManager />
            </ria:DomainDataSource.DomainContext>
</ria:DomainDataSource>

Matt.Ruwe
Matt.Ruwe

Member

Member

2 points

5 Posts

Re: Bug in DomainService class created in XAML

I'm getting an almost identical issue (different class names, but same error description).  Any help or response to this question will help multiple folks. 

Thanks,
Matt

mohnani.deepesh
mohnani....

Member

Member

251 points

48 Posts

Re: Bug in DomainService class created in XAML

This is a known issue and we are looking to fix this.

Deepesh Mohnani [MSFT]
Program Manager
Microsoft
***This posting is provided "AS IS" with no warranties, and confers no rights ***

waldred
waldred

Member

Member

702 points

113 Posts

Re: Bug in DomainService class created in XAML

A fix for this issue will be available in our next public release.

theo67
theo67

Member

Member

514 points

172 Posts

Re: Bug in DomainService class created in XAML

Will there be a more frequent update of the RIA-services?

Theo.

waldred
waldred

Member

Member

702 points

113 Posts

Re: Bug in DomainService class created in XAML

Yes, we are planning to have another CTP refresh in the future sometime around the SL3 release date.  Announcements will be made in this forum as usual.  :)

enantiomer2000
enantiom...

Member

Member

39 points

59 Posts

Re: Bug in DomainService class created in XAML

 Super.  I am fine with bugs in software that hasn't been released yet, I am just surprised that it took months to get a reply on this.  No worries though, thanks for the update.

waldred
waldred

Member

Member

702 points

113 Posts

Re: Bug in DomainService class created in XAML

enantiomer2000:
I am just surprised that it took months to get a reply on this

Me too.  Embarrassed  I just happened to be going through 'unanswered posts' and came across it.  Apologies for having missed it previously.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities