The type or namespace name "ContentBySearchWebPart" could not be found - sharepoint

Recently, I was trying to add a Content Search Web Part using csom in Visual Studio 2017, While I was adding the "ContentBySearchWebPart" class, an error occured as:
"The type or namespace name "ContentBySearchWebPart" could not be found(you are missing a using directive or an assembly reference?)".
Even I was using the namespace as "Microsoft.Office.Server.Search.WebControls" and also the "Microsoft.SharePoint.Client.Search" dll.
How can I resolve this issue?

You need to add reference "Microsoft.Office.Server.Search.dll" manually from ISAPI folder or GAC
ISAPI folder
<Windows>\Program Files\Common Files\Microsoft Shared\Web Server Extenstions\16\ISAPI
GAC
(C:\windows\Windows.NET\assembly\GAC_MSIL\Microsoft.Office.Server.Search).
Namespace: Microsoft.Office.Server.Search.WebControls
Assembly: Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/c6f03ea3-f893-4126-88e3-52a2a66b5f18/missing-assembly-reference-for-microsoftofficeserversearch?forum=sharepointdevelopmentprevious
Check your \Program Files\Common Files\Microsoft Shared\Web Server Extenstions\14\ISAPI, you'll find alot more DLL's inside this folder including your Microsoft.Office.Server.Search.dll that you are looking for.

Related

Azure Appservice - Bitbucket Deploy error

I' trying to deploy my website that is completely running in local to Azure App Service through Bitbucket and it fails.
I'm new to Azure, could enlighten me ?
Here's the log
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin\amd64'.
All packages listed in packages.config are already installed.
SystemFrameWork -> D:\home\site\repository\SystemFrameWork\bin\Release\SystemFrameWork.dll
DataAccess -> D:\home\site\repository\DataAccess\bin\Release\DataAccess.dll
SEI-Utils -> D:\home\site\repository\SEI-Utils\bin\Release\SEIUtils.dll
Consider app.config remapping of assembly "Newtonsoft.Json, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" from Version "4.5.0.0" [] to Version "6.0.0.0" [D:\home\site\repository\WebUI\bin\Newtonsoft.Json.dll] to solve conflict and get rid of warning.
D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /></dependentAssembly></assemblyBinding> [D:\home\site\repository\WebUI\SMC.WEB-UI.csproj]
SMC.WEB-UI -> D:\home\site\repository\WebUI\bin\SEI.dll
Transformed Web.config using
D:\home\site\repository\WebUI\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
Copying all files to temporary location below for package/publish:
D:\local\Temp\8d59617f714bd52.
D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(3010,5): error : Copying file Content\buz\images\.DS_Store to D:\local\Temp\8d59617f714bd52\Content\buz\images\.DS_Store failed. Could not find file 'Content\buz\images\.DS_Store'. [D:\home\site\repository\WebUI\SMC.WEB-UI.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\WebUI\SMC.WEB-UI.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d59617f714bd52";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository\.\\"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\71.10313.3301 \bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
The key error is:
error : Copying file Content\buz\images\.DS_Store to D:\local\Temp\8d59617f714bd52\Content\buz\images\.DS_Store failed. Could not find file 'Content\buz\images\.DS_Store'.
My guess is that you forgot to add this file to your repo. you'd probably see the same error if you did a local deployment using a clean clone of your repo. See here for more info.

How can we deploy from TFS to IIS on shared hosting? (GoDaddy)

The documentation found here describes how to deploy to IIS, but the WinRM component requires local admin permissions. Obviously, this isn't going to be available on shared hosting with service providers such as GoDaddy. (We'll be excluding Azure targets for the purposes of this discussion.)
Visual Studio can do this very easily, simply by using an imported .publishsettings file. Doesn't it stand to reason that TFS should be able to do the same thing without needing the extra privileges?
...or are we simply out of luck when trying to use TFS to publish to non-Azure shared hosting configurations?
--EDIT--
I've been working on Patrick's suggested answer all day, and after countless combinations of configurations I'm still coming up empty. MSBuild does look like the way to go for this, yes, but I can't get it working on my TFS 2018.
The output from the Release task is below. As we can see, MSBuild refuses to publish the site to my local testing IIS.
The strange thing is that MSBuild publishes as expected when I run the command from the logs below from a command window on my local workstation (after adjusting for the relevant file paths, of course, and removing the /dl:CentralLogger switch).
One of the things I tried was to edit/delete files on the source/target, to try to force a sync. That didn't work either.
Does anyone see any indication why this isn't working?
Log
2018-02-27T04:48:38.4708105Z ##[section]Starting: Build solution $(System.DefaultWorkingDirectory)/Website/drop/Website.vbproj
2018-02-27T04:48:38.4938123Z ==============================================================================
2018-02-27T04:48:38.4938123Z Task : Visual Studio Build
2018-02-27T04:48:38.4938123Z Description : Build with MSBuild and set the Visual Studio version property
2018-02-27T04:48:38.4938123Z Version : 1.120.0
2018-02-27T04:48:38.4938123Z Author : Microsoft Corporation
2018-02-27T04:48:38.4938123Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613727)
2018-02-27T04:48:38.4938123Z ==============================================================================
2018-02-27T04:48:41.0024890Z ##[command]"D:\Agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2018-02-27T04:48:41.7115427Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" "D:\Agent\_work\r5\a\Website\drop\Website.vbproj" /nologo /nr:false /dl:CentralLogger,"D:\Agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=6e6502d0-9bea-46af-a5a7-9dac551b9e29|SolutionDir=D:\Agent\_work\r5\a\Website\drop"*ForwardingLogger,"D:\Agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true /p:AllowUntrustedCertificate=true /p:PublishProfile="D:\Agent\_work\r5\a\Website\drop\My Project\PublishProfiles\QA.pubxml" /p:Password=******** /p:platform="AnyCPU" /p:configuration="release" /p:VisualStudioVersion="15.0" /p:_MSDeployUserAgent="TFS_1c911c00-1ecd-4ca9-87b0-d8d34f8c59c4_release_2_24_24_1"
2018-02-27T04:48:42.3456044Z Build started 2/26/2018 7:48:42 PM.
2018-02-27T04:48:44.0457237Z Project "D:\Agent\_work\r5\a\Website\drop\Website.vbproj" on node 1 (default targets).
2018-02-27T04:48:44.0487239Z CoreResGen:
2018-02-27T04:48:44.0487239Z No resources are out of date with respect to their source files. Skipping resource generation.
2018-02-27T04:48:44.2587401Z CoreCompile:
2018-02-27T04:48:44.2597397Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\vbc.exe /noconfig /imports:Intexx,Intexx.Linq,Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.ComponentModel,System.Data,System.Data.Common,System.Data.Entity,System.Data.Entity.Migrations,System.Data.SqlClient,System.IO,System.Linq,System.Xml.Linq,System.Diagnostics,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /optioncompare:Binary /optionexplicit+ /optionstrict:custom /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /optioninfer+ /nostdlib /rootnamespace:Website /sdkpath:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7" /highentropyva+ /doc:obj\release\Website.xml /define:"CONFIG=\"release\",TRACE=-1,_MyType=\"Custom\",PLATFORM=\"AnyCPU\"" /reference:D:\Agent\_work\r5\a\Website\drop\bin\EntityFramework.dll,D:\Agent\_work\r5\a\Website\drop\bin\EntityFramework.SqlServer.dll,D:\Agent\_work\r5\a\Website\drop\bin\Intexx.Core.dll,D:\Agent\_work\r5\a\Website\drop\bin\itxcorlib.dll,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.ComponentModel.DataAnnotations.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Configuration.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Core.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Data.DataSetExtensions.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Data.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Drawing.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.EnterpriseServices.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.ApplicationServices.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.DynamicData.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.Entity.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.Extensions.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.Services.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Xml.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Xml.Linq.dll" /debug+ /debug:pdbonly /optimize+ /out:obj\release\Website.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /resource:obj\release\Website.Migrations._001.resources /resource:obj\release\Website.Resources.resources /target:library /utf8output App_Code\Enums.vb Bill.aspx.designer.vb Bill.aspx.vb Contact.aspx.designer.vb Contact.aspx.vb Default.aspx.designer.vb Default.aspx.vb Defects.aspx.designer.vb Defects.aspx.vb Donate.aspx.designer.vb Donate.aspx.vb Forum.aspx.designer.vb Forum.aspx.vb Jackson.aspx.designer.vb Jackson.aspx.vb Key.aspx.designer.vb Key.aspx.vb Laws.aspx.designer.vb Laws.aspx.vb Letters.aspx.designer.vb Letters.aspx.vb Losers.aspx.designer.vb Losers.aspx.vb Main.Master.designer.vb Main.Master.vb MenuItem.ascx.designer.vb MenuItem.ascx.vb Migrations\201802040108464_001.Designer.vb Migrations\201802040108464_001.vb Migrations\Configuration.vb Migrations\Defaults.vb Models\Db\Context.vb Models\Db\Loser.vb Models\Db\NewsItem.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\MyExtensions\MyWebExtension.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" News.aspx.designer.vb News.aspx.vb Oops.aspx.designer.vb Oops.aspx.vb Pocket.aspx.designer.vb Pocket.aspx.vb Seventeenth.aspx.designer.vb Seventeenth.aspx.vb States.aspx.designer.vb States.aspx.vb Store.aspx.designer.vb Store.aspx.vb "D:\Agent\_work\_temp\.NETFramework,Version=v4.7.AssemblyAttributes.vb"
2018-02-27T04:48:44.2917430Z Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn
2018-02-27T04:48:44.5307644Z
2018-02-27T04:48:44.5357653Z _CopyFilesMarkedCopyLocal:
2018-02-27T04:48:44.5357653Z Touching "D:\Agent\_work\r5\a\Website\drop\obj\release\Website.vbproj.CopyComplete".
2018-02-27T04:48:44.5567658Z CopyFilesToOutputDirectory:
2018-02-27T04:48:44.5577603Z Copying file from "obj\release\Website.dll" to "bin\Website.dll".
2018-02-27T04:48:44.5587611Z Website -> D:\Agent\_work\r5\a\Website\drop\bin\Website.dll
2018-02-27T04:48:44.5597611Z Copying file from "obj\release\Website.pdb" to "bin\Website.pdb".
2018-02-27T04:48:44.5607636Z Copying file from "obj\release\Website.xml" to "bin\Website.xml".
2018-02-27T04:48:44.5967639Z Done Building Project "D:\Agent\_work\r5\a\Website\drop\Website.vbproj" (default targets).
2018-02-27T04:48:44.6257666Z
2018-02-27T04:48:44.6257666Z Build succeeded.
2018-02-27T04:48:44.6257666Z 0 Warning(s)
2018-02-27T04:48:44.6257666Z 0 Error(s)
2018-02-27T04:48:44.6257666Z
2018-02-27T04:48:44.6257666Z Time Elapsed 00:00:02.29
2018-02-27T04:48:44.6868621Z ##[section]Finishing: Build solution $(System.DefaultWorkingDirectory)/Website/drop/Website.vbproj
QA.pubxml
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://www.website.local</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<MSDeployServiceURL>https://server3:8172/msdeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>website</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>DOMAIN\User</UserName>
<_SavePWD>True</_SavePWD>
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="Website.Db.Context" Order="1" Enabled="False">
<Destination Path="" />
<Object Type="DbCodeFirst">
<Source Path="DBMigration" DbContext="Website.Db.Context, Website" MigrationConfiguration="Website.Migrations.Configuration, Website" />
</Object>
</ObjectGroup>
<ObjectGroup Name="Website.My.MySettings.DbConnectionString" Order="2" Enabled="False">
<Destination Path="" />
<Object Type="DbDacFx">
<PreSource Path="Data Source=(local);Initial Catalog=Website;Integrated Security=False;Persist Security Info=False;User ID=username;Password=password" includeData="False" />
<Source Path="$(IntermediateOutputPath)AutoScripts\Website.My.MySettings.DbConnectionString_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" />
</Object>
<UpdateFrom Type="Web.Config">
<Source MatchValue="Data Source=(local);Initial Catalog=Website;Integrated Security=False;Persist Security Info=False;User ID=username;Password=password" MatchAttributes="$(UpdateFromConnectionStringAttributes)" />
</UpdateFrom>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)Website.Db.Context-Web.config Connection String" />
</ItemGroup>
<ItemGroup>
<_ConnectionStringsToInsert Include="Website.Db.Context" />
</ItemGroup>
</Project>
Unlike Azure, setting up a continuous deployment from VSTS/TFS to these priced hosting servers do not have a built-in solution.
And this is bidirectional issue, TFS also greet other platform provide their official extension as a 3-party task in Marketplace. You could submit a uservoice in their site.
As a workaround, TFS is also using MSBuild in the build agent to perform build. .publishsettings also related to Azure. If you could use Web Deploy with GoDaddy locally through Visual Studio. It' should also be able to do this in TFS.
Take a look at this tutorial, using below MSBuild Argument:
/p:DeployOnBuild=true /p:PublishProfile="sitename.com - Web Deploy.pubxml" /p:AllowUntrustedCertificate=true /p:UserName="uname" /p:Password="password" /p:VisualStudioVersion=14.0
More details please refer this tutorial: HOW TO SETUP VSTS CONTINUOUS DEPLOYMENT FOR GODADDY
But according to this discussion, seems even directly using Visual Studio Web Deploy to handle with the GoDaddy is also not so stability. If you get same issue, you may deal with their support.
It turned out that I didn't have the full VS toolset installed on the server. I'd only installed the bare minimum, as I didn't need anything more than the VSTest capability.
So I updated and installed Web and Desktop this time, and the deployment sailed right through.
Credits to Microsoft Support Services for helping me with this.

Sharepoint 2013 GetGenericSetupPath return wrong path

I'm tring to obtain file path for sharepoint 2013 location without hardcoding values on code.
I found the method GetGenericSetupPath,SPUtility class, wich has a strange behaviuor:
SPUtility.GetGenericSetupPath("Template")
reuturns
"C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\15\Template"
on the 15 hive
inhstead
SPUtility.GetGenericSetupPath("template\\LAYOUTS")
return a path on 14 hive
"C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\template\LAYOUTS"
finally the default path seems to be hive 15:
SPUtility.GetGenericSetupPath("")
"C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\15\" string
After some investigation i found this post:
The problem was that
SPUtility.GetGenericSetupPath Method IS OBSOLETE
and it returns a link to the 14 hive (SharePoint 2010), not the the new 15 hive (SharePoint 2013).
Instead of this we have to use SPUtility.GetVersionedGenericSetupPath(), where you can choose wich version of sharepoint use, so you can specify:
SPUtility.GetVersionedGenericSetupPath("TEMPLATE\\FEATURES", 15)

SharePoint 2013 default favicon

I want to change the default favicon on my SharePoint site. I didn't want to change the masterpage, so I just replaced the favicon.ico file with the one I created (.ico) here: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES. It still shows the default favicon even after I did iisreset. I would appreciate any suggestions / help. Thank you!
I made it work by uploading the generated favicon to [site]/SiteAssets/Forms/AllItems.aspx and then changing the following line in the master page: < SharePoint:SPShortcutIcon runat="server" IconUrl="[site]/SiteAssets/[your_favicon_name].ico" />.
Changing favico must be done by
Change the icon, as you suggested, in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES
Empty any browser cache
Empty the IIS Temporary Cache if you have compression enabled C:\inetpub\temp\IIS Temporary Compressed Files\
(full path is C:\inetpub\temp\IIS Temporary Compressed Files\SharePoint Central Administration v4\$^_gzip_C^\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\WEB SERVER EXTENSIONS\15\TEMPLATE\IMAGES)
Stop IIS and emtpy the temporary internet files, Start IIS
Run in PowerShell to delete Temporary ASP.NET Files
net stop w3svc
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*" -Force -Recurse
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*" -Force -Recurse
net start w3svc

Strong Named satellite assemblies using ResGen & AL with multiple resx / resources files

For whatever reason, when compiling multiple .resources files into a single satellite assembly (.dll) the resources will not show. Compiling a single resource will work. Here are the steps I used...
We have a project called "Report Viewer". This project is signed using a key, MySnKey.snk via Properties > Signing > Sign the assembly , choose a strong name key file: MySnKey.snk.
All forms have been updated to Localizable = True
We processed all the resx files into German de-DE. There are only two resx: MainForm.resx (project root directory) and Resources.resx (Properties directory).
I have a folder with MainForm.de-DE.resx and Resources.de-DE.resx which are the translated versions of these files.
Using resgen,
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen" /compile Resources.de-DE.resx ReportViewer.Resources.de-DE.resources
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen" /compile MainForm.de-DE.resx ReportViewer.MainForm.de-DE.resources
This creates the appropriate .resources files. Now to link, I use AL.exe:
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL" /t:lib /embed:ReportViewer.MainForm.de-DE.resources,ReportViewer.Resources.de-DE.resources /culture:de-DE /out:ReportViewer.resources.dll /template:../../../Output/ReportViewer/bin/Debug/ReportViewer.exe /keyfile:../MySnKey.snk
This creates a ReportViewer.resources.dll file. If I place it into the appropriate sub folder de-DE>ReportViewer.resources.dll, no luck. In Program.cs, before Run is called, I have
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
IF, I only include the MainForm like
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL" /t:lib /embed:ReportViewer.MainForm.de-DE.resources /culture:de-DE /out:ReportViewer.resources.dll /template:../../../Output/ReportViewer/bin/Debug/ReportViewer.exe /keyfile:../MySnKey.snk
The appropriate resources are displayed.
This is quite confusing to me. If I add the .resx files to the solution, and compile, the output dll works correctly, but we are trying to avoid having to bring these satellite translations into the solution.
No errors are generated and the files are created so I'm lost as to what I'm not doing.
Any help is greatly appreciated. I compared the differences between the output dll when adding the files to the solution to the output file when running AL.exe and they both contain all the translations.
EDIT to include solution since I can't answer the question
Apparently I got confused with the embed option and it's usage. To properly use the AL.exe utility, I had to use:
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen" Resources.de-DE.resx ReportViewer.Properties.Resources.de-DE.resources
Notice above that the Properties namespace is added. I had not done that before.
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen" MainForm.de-DE.resx ReportViewer.MainForm.de-DE.resources
Notice that no Properties namespace is added since MainForm is Simply in the ReportViewer namespace.
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL"
/t:lib
/embed:ReportViewer.Properties.Resources.de-DE.resources
/embed:ReportViewer.MainForm.de-DE.resources
/culture:de-DE /out:ReportViewer.resources.dll /template:../../../Output/ReportViewer/bin/Debug/ReportViewer.exe /keyfile:../MySnKey.snk
Notice that there are multiple /embed items in this line. I was using the comma, which renames the internals and is not what I wanted. Providing a space between the files gives a (seemingly) unrelated error. See http://ondotnet.com/pub/a/dotnet/2002/10/14/local2.htm?page=2 for a great article.
For completeness, another way of writing this script would be
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen" Resources.de-DE.resx
notice that no renaming is done here, the output is simply Resources.de-DE.resources
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ResGen" MainForm.de-DE.resx
notice that no renaming is done here, the output is simply MainForm.de-DE.resources
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL" /t:lib
/embed:Resources.de-DE.resources,ReportViewer.Properties.Resources.de-DE.resources
/embed:MainForm.de-DE.resources,ReportViewer.MainForm.de-DE.resources
/culture:de-DE
/out:ReportViewer.resources.dll /template:../../../Output/ReportViewer/bin/Debug/ReportViewer.exe /keyfile:../MySnKey.snk
Notice that the renaming is done following the comma in the embed option. The first argument is the file name (the .resources file) and after the comma is the fully qualified name (namespace.class.xx-XX.resources).
Answered in the post before I knew I could answer it here.

Resources