<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : using weirdness</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : using weirdness</description>
  <pubDate>Tue, 21 Apr 2026 15:51:22 -700</pubDate>
  <lastBuildDate>Mon, 19 Jul 2010 14:08:44 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1973</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>using weirdness : Re: R# - Have encountered this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1973&amp;PID=7681#7681</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 1973<br /><strong>Posted:</strong> 19-Jul-2010 at 2:08pm<br /><br /><P>Re: R# - Have encountered this too. I am a R# fan. Not sure what to do. Tempted to blame R# :-)</P><DIV>I believe the root cause is the ordering of the usings which plays into the compiler's resolution of competing extension methods. That's why one ordering of the "usings"&nbsp;works and the other does not. I'm not&nbsp;sure&nbsp;that there is anything we&nbsp;COULD do about it.</DIV><DIV>&nbsp;</DIV><DIV>Personally, I think of it as a PITA, not a "big problem". You encounter it once per ViewModel class. If you're writing that many ViewModel classes by hand, I'd be tempted to (a) write a CodeSnippet, (b) write a R# live template or (c - my fav) write a&nbsp;Visual Studio VM class file template&nbsp;to spit out the boiler plate.</DIV><DIV>&nbsp;</DIV><DIV>--</DIV><DIV>&nbsp;</DIV><DIV>Re: Designer Troubles</DIV><DIV>&nbsp;</DIV><DIV>"Our Bad". </DIV><DIV>&nbsp;</DIV><DIV>Through DevForce v.6.0.3 we required that the paired model assemblies (regular .NET and Silverlight .NET) have the same assembly name. Our bad.&nbsp;The application&nbsp;compiles and works with this convention but tooling hates it.</DIV><DIV>&nbsp;</DIV><DIV>The Designers (and R# and TFS btw) get confused when they see two assemblies with the same name. Only one of them is used in Silverlight. </DIV><DIV>&nbsp;</DIV><DIV>Unfortunately, the tooling lives in regular .NET and decides to look at both assemblies EVEN THOUGH ONLY THE SL ASSEMBLY COULD EVER BE USED.</DIV><DIV>&nbsp;</DIV><DIV>Fat chance getting Microsoft (or R#) to fix this. We must accommodate them.</DIV><DIV>&nbsp;</DIV><DIV>As of&nbsp;DF v.6.0.4 (to be released shortly), the desktop and SL model assemblies can AND SHOULD have distinct assembly names (e.g., Model.Desktop and Model.SL).&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>Our templates will take care of this for new applications. You will have to change the assembly names of model projects in&nbsp;existing applications (like yours). Your Designer problems will go away.</DIV><DIV>&nbsp;</DIV><DIV>N.B.: </DIV><DIV>&nbsp;</DIV><DIV>The namespaces must be the same. The employee class must be "YourModel.Employee" in both "YourModel.Desktop" and "YourModel.SL"</DIV><DIV>&nbsp;</DIV><DIV>--</DIV><DIV>&nbsp;</DIV><DIV>When converting&nbsp;simple demo applications with two projects (SL and Web), the Web project is the regular .NET model project.&nbsp;For example, in apps created with templates from v.6.0.3, the assembly names in&nbsp;MyApp and MyApp.Web&nbsp;are both "MyApp".&nbsp;I recommend that you leave that assembly name alone in the web project. Go to the Silverlight application project and change it's name&nbsp;to "MyApp.SL".</DIV><DIV>&nbsp;</DIV><DIV>--</DIV><DIV>&nbsp;</DIV><DIV>Sometimes, when you change the name of the&nbsp;regular .NET&nbsp;assembly with the EDMX in it, the app won't start; you'll see an exception complaining about not being able to find the endpoint and asking you to try all kinds of stuff (e.g, set Copy Local = true for the IdeaBlade assemblies). These are all common causes of the problem DevForce is struggling to resolve. They are NOT the cause in this case.</DIV><DIV>&nbsp;</DIV><DIV>The problem is that both Visual Studio and&nbsp;EntityFramework EDMX got confused. It's holding on to an old EF connection string that describes&nbsp;the location of the Entity Framework part files (CSDL, MSL, and SSDL).</DIV><DIV>&nbsp;</DIV><DIV>The telltale sign of this: open the EDMX and "Update from Database". If it needs help finding the database (it will show a wizard for finding the database), you know that the EF connection string has changed. </DIV><DIV>&nbsp;</DIV><DIV>Often you can't find the difference. It's there but the string is so long that it's hard to see.</DIV><DIV>&nbsp;</DIV><DIV>- Help it find the database. </DIV><DIV>- Find its updated &lt;ConnectionString&gt; either in the model app.config or the web.config.</DIV><DIV>- Copy that &lt;connection string&gt; to the config file(s) that need it (e.g., web project's web.config, test project app.configs, etc.). </DIV><DIV>- If your config defines EDM keys, update them with the string</DIV><DIV>&nbsp;</DIV><DIV>** Extra Voodoo **</DIV><DIV>&nbsp;</DIV><DIV>Sometimes you STILL get trouble. Maddening. Here are some steps that I follow (after hitting my head on the desk):</DIV><DIV>&nbsp;</DIV><DIV>- Clean the solution</DIV><DIV>- Delete bin directories</DIV><DIV>- Close and reopen Visual Studio</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 19 Jul 2010 14:08:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1973&amp;PID=7681#7681</guid>
  </item> 
  <item>
   <title>using weirdness : Hi  I&amp;#039;m helping a team...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1973&amp;PID=7675#7675</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=859" rel="nofollow">slkiwi</a><br /><strong>Subject:</strong> 1973<br /><strong>Posted:</strong> 19-Jul-2010 at 3:52am<br /><br />Hi<DIV>&nbsp;</DIV><DIV>I'm helping a team of newbie devs evaluate DevForce and have run into some very weird stuff!</DIV><DIV>&nbsp;</DIV><DIV>The main problem I have is that the using statements in the ViewModel class need to be exactly right.</DIV><DIV>&nbsp;</DIV><DIV>I have the following code:</DIV><DIV>&nbsp;</DIV><DIV>using System.Collections.ObjectModel;<BR>using IdeaBlade.EntityModel;</DIV><DIV>&nbsp;</DIV><DIV>namespace XXX.DevForce.SL<BR>{<BR>&nbsp;&nbsp;&nbsp; public class MainPageViewModel<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private ObservableCollection&lt;Customer&gt; Customers { get; set; }</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void Loaded()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Customers = new ObservableCollection&lt;Customer&gt;();</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var mgr = new DevForceDbEntities();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var query = mgr.Customers;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; query.ExecuteAsync(op =&gt; op.Results.ForEach(Customers.Add));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>}<BR></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Now the above doesn't compile - I get an ambiguous reference on op.Results.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>The above code was typed without the using statements, then (using ReSharper) the using statements were inserted. (That is, I inserted the using statements that ReSharper suggested. This normally works fine.)</DIV><DIV>&nbsp;</DIV><DIV>But something is wrong - I have to manually correct the using statements to read as follows:</DIV><DIV>&nbsp;</DIV><DIV>using System.Collections.ObjectModel;<BR>using IdeaBlade.Core;<BR>using IdeaBlade.EntityModel;<BR></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Given that we're ReSharper fans, this is of concern to us.</DIV><DIV>&nbsp;</DIV><DIV>So, what is causing this? I really don't understand - but it's a big problem for us. It's taken me quite some time chasing down this problem to identify the exact cause.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>On another matter (and I don't know whether it's related to DevForce or not) I have tried to implement an IValueConverter class in my Silverlight project. However, when I refrence it in the XAML (in the UserControl.Resources) I get errors in the Cider designer:</DIV><DIV>&nbsp;</DIV><DIV>Error&nbsp;1&nbsp;The type 'SL:BoolToVisibilityConverter' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.&nbsp;C:\Projects\Visual Studio Projects\XXXDevForce1\XXX.DevForce.SL\MainPage.xaml&nbsp;6&nbsp;10&nbsp;XXX.DevForce.SL<BR></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>I have tried the exact same code in another non-DevForce Silverlight 4 project and the IValueConverter class works fine. </DIV><DIV>&nbsp;</DIV><DIV>I have found that if I put the IValueConverter into a separate Silverlight class library and reference it from the main Silverlight project I can get around the error.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Anyway, any help with these issues would be much appreciated.</DIV><DIV>&nbsp;</DIV><DIV>Best regards,</DIV><DIV>&nbsp;</DIV><DIV>Craig</DIV><DIV>&nbsp;</DIV><DIV>(Auckland, New Zealand)</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 19 Jul 2010 03:52:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1973&amp;PID=7675#7675</guid>
  </item> 
 </channel>
</rss>