I seem to have encountered the same problem. The stderr file DomII generates tells me that 'Något gick fel! mod has no #modname'. If the mod is in my Dominions II\mods\ folder, the crashes at startup.
I fixed it by creating a new .dm file from an existing mod, an copypasting the unworking mod command by command. In the end, everything worked. So I just pasted
everything to the new mod file, and it worked! I don't know what the problem was, but having renamed the nonworking mod to something else to be able to start Dominions at all didn't do a thing. This is very strange, and could cause one to stop modding, frustrated with a mysterious bug. Had I not modded before, I would have just given up on this.
