error MSB3103: Invalid Resx file. The specified module could not be found

Viewed 2363

I am trying to build c# project with Jenkins and build.ps1 inside docker for the FIRST times.

Detail Error:

C:\myproject\Properties\Resources.resx : error MSB3103: Invalid Resx file. Type in the data at line 123, position 5, cannot be loaded because it threw the following exception during construction: The specified module could not be found [C:\myproject\myproject.Config.csproj]

May I know why it happens? Any reason?

Update

this is resources.resx

 121  : <data name="config_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
 122  :   <value>..\Resources\config_icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
 123  : </data>

this is Config.csproj

 123  : <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
 124  :<HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net46\CommonServiceLocator.dll</HintPath>
 125  :       </Reference>

I am not sure this line no in error message is really pointing the error or not.

2 Answers

In Properties Windows(Ctrl+W, P) in .resx file change persistence property to: "Embedded in .resx file" to resolve Problem.

if you use docker image to build your project in Linux system all resource name must be in lowercase Related Answer

This is maybe some useful for u if u also having this issue. It took a week for me :(

This error is because of server core, core cant recognizes that kind of format. Need to use another window.

Here is ref link => dotnet build fails

Update

This is my latest docker file for this issue and working fine. take a look at it and ref if u want.

It needed to install not only MSBuild tools but also Management Build tools.

#Base Image
FROM mcr.microsoft.com/windows:1903

#Copy Needed Folder
ADD ./setup c:/jenkins 
ADD ./jenkinsdata c:/jenkinsdata

#Jenkins
RUN ["msiexec.exe", "/i", "C:\\jenkins\\jenkins.msi", "/qn"]

#Java
RUN powershell start-process -filepath C:\jenkins\jre-8u251-windows-i586.exe -passthru -wait -argumentlist "/s,INSTALLDIR=c:\Java\jre1.8.0_91,/L,install64.log"

RUN set JAVA_HOME=""c:\\Java\\jre1.8.0_91\\"
RUN set PATH=%PATH%,%JAVA_HOME%\bin

# Install Chocolatey
RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "$env:ChocolateyUseWindowsCompression='false'; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
RUN powershell choco feature enable -n=allowGlobalConfirmation

# Install Git
RUN powershell choco install git --allow-empty-checksums -y 

# Install DotNet 4.6.1
RUN powershell choco install netfx-4.6.1-devpack --allow-empty-checksums -y 

# Install MsBuild
RUN powershell choco install visualstudio2017buildtools --allow-empty-checksums -y 

# Install ManagementBuildTools
RUN powershell choco install visualstudio2017-workload-manageddesktopbuildtools --allow-empty-checksums -y 

# Delete files
RUN Powershell.exe -Command remove-item c:/jenkins –Recurse  
Related