How can I fix my invalid resx file input? - winforms

I added several existing files (from a VS 2008 Windows CE project) to a VS 2008 Winforms project. For many (but not all) of the forms, I get this err re: the *.resx files:
Invalid Resx file. ResX input is not valid. Cannot find valid "resheader" tags for the ResX reader and writer type names.
The *.resx files that are fine display like so when I 2-click them in the Solution Explorer:
...whereas those that won't compile with the err msg above display one thing if I 2-click the *.resx file in the Solution Explorer, to wit:
...but the error-invoking *.resx files show their code if I 2-click the line in the Error List, like so:
. . .
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
. . .
Note: The solution here C# resx file error: doesn't seem to apply to my situation, as the out-of-kilter / off-the-rails files already have this format:
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
Why are some resx files fine while the others prevent compilation? How can I massage/tweak them to get past the compile gauntlet?

I'm a little surprised that you can have the $ sign in the resource name.

Related

wpf localization - locbaml - file is being used by another process

I have been looking hours for a solution, but I donĀ“t find it.
I want to generate a satellite assembly with following command.
locbaml.exe /generate de/App.UI.resources.dll /trans:MeineRess_de.csv /out:de /cul:de
After executing I get following error:
The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
Can anybody help me, Thx
Output to a separate folder try for example c:\ this would work
locbaml.exe /generate de/App.UI.resources.dll /trans:MeineRess_de.csv /out:c:\ /cul:de
For posterity:
The file name without any command line flag is the original input assembly. So you're reading in de/App.UI.resources.dll and then /out:de is trying to write to the same file in the same folder.
Probably you want to change de/App.UI.resources.dll to [UiCulture]/App.UI.resources.dll where [UiCulture] is the <UICulture> from your project file, which should match the NeutralResourcesLanguage attribute in your assembly (AssemblyInfo.cs normally).
Perhaps you legitimately want to overwrite the original DLL (though I don't think that makes sense), but this will not be possible as-is because locbaml will load the assembly from file, which holds the file handle open until the application exits. (Technically until the AppDomain is destroyed.)

ILRepack exe doesn't locate xaml file

I have a WPF exe I want to merge with its referenced libraries, so I tried ILRepack. The merging is done fine and the final executable is pretty fat.
But when I try to launch it, it stop to work, and when I debug in Visual Studio I get an "IOException - Cannot locate resource 'mainwinwows.xaml'" (the original message is in french, the translation might be not very accurate). The StartupUri is correct.
Here is my command line:
ILRepack.exe "C:\<Some path>\originalExe.exe" /lib:"C:\<Some path>\libsToInclude" /out:"C:\<Some path>\finalExe.exe" /log:"C:\<Some path>\logBuild.log" /target:winexe
Should I merge the xaml file with the other libraries ?

SSDT: "Identifiers must include at least one name (for example, MyTable)"

Two days trying to find the origin of this error and can not ...
My problem is the same: Link
When i build my db project the following error occur:
"Identifiers must include at least one name (for example, MyTable)"
Build output:
C:\Program Files (x86)\MSBuild\12.0\bin\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll" /debug+ /debug:full /optimize- /out:obj\Debug\Objetivo.Rango.BancoDados.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output "C:\Users\Vinicius\AppData\Local\Temp.NETFramework,Version=v4.5.SqlClrAttributes.cs"
Loading project references...
Loading project files...
Building the project model and resolving object interdependencies...
Validating the project model...
Writing model to D:\WorkspaceObjetivoSistemas\ObjetivoSistemas\Rango\RamoPrincipal\Rango\Objetivo.Rango.BancoDados\obj\Debug\Model.xml...
Writing create script to Rango_Create.sql...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(546,5): Error: : Identifiers must include at least one name (for example, MyTable).
Done building project "Objetivo.Rango.BancoDados.sqlproj" -- FAILED.
I Finally solved my problem.
There was a bug in .refactorlog file...
This error message is too vague and it's not enough to know where the problem is happening ...
I accidentally reproduced this by using the Refactor menu tool to rename some columns, making several other changes, then UNDOING all changes via TFS.
A couple of original refactor items were left in the .refactorlog file after the Undo. Once I removed them from the xml, publishing worked as expected.

Allegro load_bitmap not working

i'm trying to load bitmap like this:
BITMAP *image = load_bitmap("picture.bmp", NULL);
when I test it:
if (image == NULL)
printf("No image loaded\n");
it prints No image loaded so load_bitmap doesn't work ... i have also tried absolute path but still nothing.
Im using Ubuntu and allegro 4.2
Some suggestions?
Did you try placing the image on the same location as the executable? After that is solved check this things also if still getting the error:
Is really a *.bmp file? A file of a different type can not be converted by just renaming it.
Is the file you are trying to read actually called like that? Check for spelling both in code and in the file explorer.
Does the program run correctly if executed from the file explorer or command-line but not from the IDE? If that is the case, then you should change the configuration of the workspace or project you are currently using so that the execution directory is the same as the one where the image file is located.
If all else fails then try following the steps of the tutorial again, perhaps you made something wrong. By the way, if this is your first C++ project I recommend you that instead go to more basic stuff and stick to the command-line for a while until you get the hang of the facilities the language and its libraries have to offer.

Is there a MIME type for C# (.cs) files?

Standard UNIX tools (file command) return text/x-c++. This is not the greatest result possible.
On Windows urlmon.dll/FindMimeFromData returns text/plain. Looks like Windows never got any decent file type recognition library.
Is there something more precise than text/plain?
I was looking for the same thing on Ubuntu 20.04 - open .CS files in Code and other text files in the default editor.
I copied the line form the /usr/share/applications/defaults.list
text/plain=org.gnome.gedit.desktop
and added the .cs extension like so
text/plain.cs=code
Now my CS files open in VS Code and all other plain text files open in the default editor

Resources