Troubles with Web Site project and class library with resources

Last post 11-24-2008 3:17 PM by sjoholm. 7 replies.

Sort Posts:

  • Troubles with Web Site project and class library with resources

    06-25-2007, 4:21 AM
    • Member
      5 point Member
    • Liwoj
    • Member since 10-23-2006, 10:30 AM
    • Posts 3

    Hi

    Here is my solution setup and problem description

    1) projects

    - VS.NET 2005 web site (Mediaresearch.Sworm.Web)

    - C# Class library project containing code and resources (Mediaresearch.Sworm.BLL) This project is referenced by web site using project reference. Project contains one default resource file and one resource for EN neutral culture.

    - Web deployment project

    2) Contet of Bin folder of web site is NOT in source control. Web site is referencing only projects in the same solution. This is because I do not want the files, which are changing frequently to be in SVN.

    3) Previous point is important because it means that Bin directory of Web Site doesn't containt folder with name "en" (remember, we are in web site project so neither local nor global resources are compiled- without using WDP)

    4) When i build my web site,satellite assembly is created for my library project in "en" subfolder of its bin folder. But this dll is NOT copied to web site bin folder ! VS.NET shows following message:

    Cannot copy assembly 'Mediaresearch.Sworm.BLL.resources.dll' to file 'd:\Pool\SWORM\src\Mediaresearch.Sworm.Web\Bin\en\Mediaresearch.Sworm.BLL.resources.dll'. Unable to add 'd:\Pool\SWORM\src\Mediaresearch.Sworm.BLL\obj\Debug\en\Mediaresearch.Sworm.BLL.resources.dll' to the Web. Unable to add file 'Bin\en\Mediaresearch.Sworm.BLL.resources.dll'. The system cannot find the path specified.

    5) When i build WDP project (which in turn builds web site), satellite assembly is copied directly to web site bin folder and to precompiled sites Bin folder insted of its "en" subfolder. This is strange and not very useful.

    6) When i manualy create "en" subfolder inside web site bin folder, vs.net web site build works like a charm - assembly is copied to "en" subfolder and nowhere else. WDP build from VS.NET in this case again copy satellite assembly to "en" folder and directly to Bin folder of web site and precompiled site

    BUT WDP build from command line (msbuild xxx.wdproj) still do not create\copy satellite assembly to "en" folder of site\precompiled site ! 

    So there are IMHO at least 2 problems:

    A) VS.NET is not able to create "culture directories" in the web site Bin folder and compile web site corectly when it is referencing class library containing multi-language resources. After manualy creating "culture directory" inside web site bin folder, web site builds ok.

    B) WDP can not handle build of Web site project referencing class library containing multi-language resources when run from command line. It is copying library's satelite assemblies directly to Bin folder of source and precompiled site... Problem is probably in ResolveAssemblyReferences target.

    Has anybody seen this issue? What do you think ?

    Thanx, Liwoj

  • Re: Troubles with Web Site project and class library with resources

    08-02-2007, 9:20 AM
    • Member
      5 point Member
    • Liwoj
    • Member since 10-23-2006, 10:30 AM
    • Posts 3

    Hey !

    I think this is quite serious bug described by quite good bug report ;)

    Please ! Sould someone fromWDP team take a look at it ?

    Liwoj

  • Re: Troubles with Web Site project and class library with resources

    12-24-2007, 3:03 PM
    • Member
      94 point Member
    • VishalRJoshi
    • Member since 12-03-2007, 2:36 AM
    • Redmond, WA, USA
    • Posts 23

    Hi,

        I am sorry you are facing this issue but at the same time thanks for bringing it up...    We will try to reproduce the issue and try to get to the bottom of it... 

    If possible could you let us know your OS, Visual Studio build number (Help --> About) and also whether you are using te Dec 2007 CTP of WDP?

    wishes

    Vishal R. Joshi | Program Manager | Visual Studio Web Developer

    Vishal R. Joshi | Twitter: @VishalRJoshi | http://vishaljoshi.blogspot.com/
  • Re: Troubles with Web Site project and class library with resources

    10-29-2008, 6:53 AM
    • Member
      33 point Member
    • sjoholm
    • Member since 10-31-2005, 2:06 PM
    • Posts 9

    I'm have the same problem with WDP 2008 is there any know workaround for this issue?

    When I build my web site from VS 2008 referring myclasslib the myclasslib.resource.dll is properly generated in the website/bin and the site works like a charm e.g:

    /mywebsite/bin/sv/myclasslib.resources.dll

    But when i build my WDP using msbuild /mywebsite/bin/sv/myclasslib.resources.dll is missing thus the site will only show the default culture.

    The classlib is referenced as a project not as dll from the website if that would provide any help

  • Re: Troubles with Web Site project and class library with resources

    10-29-2008, 12:42 PM
    • Member
      33 point Member
    • sjoholm
    • Member since 10-31-2005, 2:06 PM
    • Posts 9

    Update

     I've made a simple solution to reproduce the error see the lines below. The problem, as far as I can see, is that every language resource.dll \*\MyClassLib.resources.dll is copied to the same place

     D:\Projects\brikks-rnd\resource-issue\src\website\Bin\MyClassLib.resources.dll so only the last one will be spared

    It's not possible to reproduce the behavior when building the WDP from VS 2008 but only using msbuild.exe which is necessary for our Continous Integration Nant task

     

    1    ResolveAssemblyReferences:
    2 Copying file from "D:\Projects\brikks-rnd\resource-issue\src\MyClassLib\bin\Debug\MyClassLib.dll" to "D:\Projects\brikks-rnd\resource-issue\src\website\Bin\MyClassLib.dll".
    3 Copying file from "D:\Projects\brikks-rnd\resource-issue\src\MyClassLib\bin\Debug\MyClassLib.pdb" to "D:\Projects\brikks-rnd\resource-issue\src\website\Bin\MyClassLib.pdb".
    4 Copying file from "D:\Projects\brikks-rnd\resource-issue\src\MyClassLib\bin\Debug\no\MyClassLib.resources.dll" to "D:\Projects\brikks-rnd\resource-issue\src\website\Bin\MyClassLib.resources.dll".
    5 Copying file from "D:\Projects\brikks-rnd\resource-issue\src\MyClassLib\bin\Debug\sv\MyClassLib.resources.dll" to "D:\Projects\brikks-rnd\resource-issue\src\website\Bin\MyClassLib.resources.dll".
    6 Copying file from "D:\Projects\brikks-rnd\resource-issue\src\MyClassLib\bin\Debug\tr\MyClassLib.resources.dll" to "D:\Projects\brikks-rnd\resource-issue\src\website\Bin\MyClassLib.resources.dll".
    7 AspNetMerge:
    8 Running aspnet_merge.exe.
    9 Successfully merged '.\TempBuildDir'.
    10 .....
  • Re: Troubles with Web Site project and class library with resources

    10-30-2008, 4:56 AM
    • Member
      33 point Member
    • sjoholm
    • Member since 10-31-2005, 2:06 PM
    • Posts 9
    A simple and not so ugly solution of the problem

     

      <Target Name="BeforeBuild">
        <CreateItem Include="..\MyClassLib\bin\$(Configuration)\**\*.resources.dll">
          <Output TaskParameter="Include" ItemName="ResourceDlls" />
        </CreateItem>
        <Copy 
          SourceFiles="@(ResourceDlls)" 
          DestinationFolder="..\website\Bin\%(RecursiveDir)" 
          ContinueOnError="false" />
        <Delete 
          Files="..\website\Bin\MyClassLib.resources.dll"
          ContinueOnError="false" />
      </Target>
    
      
  • Re: Troubles with Web Site project and class library with resources

    11-24-2008, 3:02 PM
    • Member
      6 point Member
    • petmon
    • Member since 10-31-2007, 4:50 PM
    • Posts 3

    This bug's just delayed the launch of our new project - our build and deployment process relies on wdproj and we are are using the web site project model for the first time.

    Microsofties - please fix and announce an update to wdproj.

     

    Thanks,

    Pete.

  • Re: Troubles with Web Site project and class library with resources

    11-24-2008, 3:17 PM
    • Member
      33 point Member
    • sjoholm
    • Member since 10-31-2005, 2:06 PM
    • Posts 9

    Pete, have you tried my workaround in the previous post:

    http://forums.asp.net/p/1125813/2765136.aspx#2714044

     

Page 1 of 1 (8 items)