Skip to main content

Microsoft Silverlight

Answered Question DLL file missing from .xap fileRSS Feed

(0)

ken.smith
ken.smith

Member

Member

70 points

45 Posts

DLL file missing from .xap file

I have a solution with three separate Silverlight projects in it + a separate web project.  Two of the Silverlight projects are "Application" projects (SlideLinc.Client and SlideLinc.Client.Whiteboard), and the third is a Silverlight library project that I'm trying to use to host some shared style resource (SlideLinc.Client.Resources). 

My problem (among many) is that the Silverlight library project doesn't show up in the .xap file that sits in the web site's /ClientBin directory.  

The output from the build shows the first two projects getting inserted into the .xap file, but not the third:

Begin Xap packaging
Packaging SlideLinc.Client.dll
Packaging SlideLinc.Client.Whiteboard.dll
Packaging System.ComponentModel.DataAnnotations.dll
Packaging System.ComponentModel.dll
Packaging System.ServiceModel.PollingDuplex.dll
Packaging System.Windows.Controls.dll
Packaging System.Windows.Controls.Input.Toolkit.dll
Packaging System.Windows.Controls.Layout.Toolkit.dll
Packaging System.Windows.Controls.Navigation.dll
Packaging System.Windows.Ria.dll
Packaging System.Xml.Serialization.dll
Packaging System.Windows.Controls.Toolkit.dll
Packaging ServiceReferences.ClientConfig
Packaging scripts\Camera.js
Packaging scripts\FlashHost.js
Packaging AppManifest.xaml
Xap packaging completed successfully

And when I open the .xap file (by renaming it to .zip), the SlideLinc.Client.Resource.dll isn't in there.

Before y'all ask, I'm referencing the resource DLL from both the "Application" projects.  And the DLL is being built successfully:

------ Rebuild All started: Project: SlideLinc.Client.Resources, Configuration: Debug Any CPU ------
C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;SILVERLIGHT /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\mscorlib.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\system.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\System.Net.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\System.Windows.Browser.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\System.Windows.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\System.Xml.dll" /debug+ /debug:full /optimize- /out:obj\Debug\SlideLinc.Client.Resources.dll /resource:obj\Debug\SlideLinc.Client.Resources.g.resources /target:library Dummy.cs Properties\AssemblyInfo.cs

Compile complete -- 0 errors, 0 warnings
SlideLinc.Client.Resources -> C:\source\slidelinc\branches\28_SlideLincClient_ken\SlideLinc.Client.Resources\Bin\Debug\SlideLinc.Client.Resources.dll
 

I tried deleting the project and re-implementing it as a Silverlight Application (instead of a Silverlight Class Library), but no go.

Any other suggestions? Am I missing something?

Ken Smith

ksleung
ksleung

Contributor

Contributor

5198 points

993 Posts

Re: DLL file missing from .xap file

Did you have the "Copy Local" property set to false?

ken.smith
ken.smith

Member

Member

70 points

45 Posts

Re: DLL file missing from .xap file

 Good question.  But it's set to "True", the default.

Ken Smith

jamlew
jamlew

Contributor

Contributor

2786 points

425 Posts

Microsoft

Re: DLL file missing from .xap file

Does the main Silverlight project have a reference to SlideLinc.Client.Resources, or is it only referenced by the SlideLinc.Client..*.dll libraries?  If it doesn't reference it, can you try adding the reference?  There is an msbuild bug where if you have a reference to assembly A, which in turn depends on assembly B, but no types from assembly B are referenced in code (code != XAML), we don't catch the dependency correctly.

---------
If this post has solved your problem, please select 'Mark as answer'

- Jimmy Lewis
Microsoft SDET
Visual Web Developer Team
Silverlight Tools for VS

ken.smith
ken.smith

Member

Member

70 points

45 Posts

Re: DLL file missing from .xap file

Thanks for the response. The main Silverlight app (SlideLinc.Client) does have a direct reference to the resource project. I also wondered about the possibility of an msbuild issue, so I added a dummy class to the resource project, referenced it in SlideLinc.Client, and called one of its methods. But it still didn't show up in the .XAP file -- and, of course, SlideLinc.Client threw an error when the method was called.

Ken Smith

pyt
pyt

Member

Member

33 points

16 Posts

Re: DLL file missing from .xap file

I'm having the same exact issue. Did you find a solution?

Pierre-Yves Troel
Ayuda Media Systems
http://www.ayudasystems.com

ken.smith
ken.smith

Member

Member

70 points

45 Posts

Re: DLL file missing from .xap file

Nope, never did. I got tired of trying to fix it, so I got rid of the Resources project, and copied the appropriate files to both projects. If anyone does have a solution, I'd love to hear it.

Ken Smith

pyt
pyt

Member

Member

33 points

16 Posts

Answered Question

Re: DLL file missing from .xap file

I think I might actually have found the issue. It seems to be related to having Resource in the name of the project.

I tried with a different name and it worked.

Now I have another issue, there are multiple dlls generated when you compile the project (one per culture) but the only one ending up in the xap is the default culture...

 

Pierre-Yves Troel
Ayuda Media Systems
http://www.ayudasystems.com

ken.smith
ken.smith

Member

Member

70 points

45 Posts

Re: DLL file missing from .xap file

Cool! That's worth a bug report.

Ken Smith

pyt
pyt

Member

Member

33 points

16 Posts

Re: DLL file missing from .xap file

Figured out my problem, I needed to add the supported cultures in my csproj, everything works fine now.

<SupportedCultures>en;fr</SupportedCultures>
 

Pierre-Yves Troel
Ayuda Media Systems
http://www.ayudasystems.com
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities