cyberjunk / meridian59-dotnet

New 3D client and tools for Meridian 59
GNU General Public License v3.0
34 stars 36 forks source link

Error - Assembly Signing Access Denied (VS 2017 Community) #261

Closed NHuebner1983 closed 6 years ago

NHuebner1983 commented 6 years ago

Hi there,

I have spent about 4 hours trying to get this to work, finally ended with this error after "Finished generating code". Hopefully someone knows how to fix it. I have 100% pulled code from origin/master branch for meridian59-dotnet adn meridian59-engine. I have built Engine in VS2017 for Debug/Release x64/Win32

I have confirmed that Ogre.Client in my SLN is pointing at ../Meridian59/Meridian59.snk

I read up that I needed to generate a new "Strong Name" file, but I'm lost on where and how I do that. I'm not sure why the SNK file already provided isn't working.

I checked there are no permission issues (I assumed that's what Access Denied was).

Any thoughts?

LNK1256 
ALINK operation failed (80040436) : 
Error signing assembly -- Access is denied. 
Meridian59.Ogre.Client  
C:\M59_ALL\_M59DN\Meridian59.Ogre.Client    
C:\M59_ALL\_M59DN\Meridian59.Ogre.Client\LINK   
fatal   Build       
Link
NHuebner1983 commented 6 years ago

Here's my output during a Debug x64 Build:

1>------ Build started: Project: Meridian59.Patcher, Configuration: Debug x86 ------
2>------ Build started: Project: Meridian59.BgfEditor, Configuration: Debug x64 ------
3>------ Build started: Project: Meridian59.Bot.Shop, Configuration: Debug x64 ------
4>------ Build started: Project: Meridian59.Bot.Spell, Configuration: Debug x64 ------
5>------ Build started: Project: Meridian59.Bot.IRC, Configuration: Debug x64 ------
6>------ Build started: Project: Meridian59.UnitTest, Configuration: Debug x64 ------
7>------ Build started: Project: Meridian59.RooViewer, Configuration: Debug x64 ------
1>  Meridian59.Patcher -> C:\M59_ALL\_M59DN\Meridian59.Patcher\bin\x86\Debug\Meridian59.Patcher.exe
8>------ Build started: Project: Meridian59.Ogre.Client, Configuration: Debug x64 ------
9>------ Build started: Project: Meridian59.RsbEditor, Configuration: Debug x64 ------
9>  Meridian59.RsbEditor -> C:\M59_ALL\_M59DN\Meridian59.RsbEditor\bin\x64\Debug\Meridian59.RsbEditor.exe
3>  Meridian59.Bot.Shop -> C:\M59_ALL\_M59DN\Meridian59.Bot.Shop\bin\x64\Debug\Meridian59.Bot.Shop.exe
4>  Meridian59.Bot.Spell -> C:\M59_ALL\_M59DN\Meridian59.Bot.Spell\bin\x64\Debug\Meridian59.Bot.Spell.exe
10>------ Skipped Build: Project: Meridian59.BgfService, Configuration: Debug Any CPU ------
10>Project not selected to build for this solution configuration 
5>  Meridian59.Bot.IRC -> C:\M59_ALL\_M59DN\Meridian59.Bot.IRC\bin\x64\Debug\Meridian59.Bot.IRC.exe
2>C:\M59_ALL\_M59DN\Meridian59.BgfEditor\Forms\MainForm.Designer.cs(1016,56,1016,88): warning CS0169: The field 'MainForm.cutTransparencyToolStripMenuItem' is never used
2>  Meridian59.BgfEditor -> C:\M59_ALL\_M59DN\Meridian59.BgfEditor\bin\x64\Debug\Meridian59.BgfEditor.exe
7>  Meridian59.RooViewer -> C:\M59_ALL\_M59DN\Meridian59.RooViewer\bin\x64\Debug\Meridian59.RooViewer.exe
6>  Meridian59.UnitTest -> C:\M59_ALL\_M59DN\Meridian59.UnitTest\bin\x64\Debug\Meridian59.UnitTest.dll
8>stdafx.cpp
8>Application.cpp
8>AssemblyInfo.cpp
8>ControllerEffects.cpp
8>ControllerInput.cpp
8>ControllerRoom.cpp
8>ControllerSound.cpp
8>ControllerUI.cpp
8>DataControllerOgre.cpp
8>ImageBuilders.cpp
8>ImageComposerCEGUI.cpp
8>ImageComposerOgre.cpp
8>Language.cpp
8>MiniMapCEGUI.cpp
8>OgreClient.cpp
8>OgreClientConfig.cpp
8>OgreListeners.cpp
8>OISKeyBinding.cpp
8>OISListeners.cpp
8>ParticleUniverseEventHandlers.cpp
8>ProjectileNode2D.cpp
8>OgreClientConfig.cpp(389): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
8>RemoteNode.cpp
8>RemoteNode2D.cpp
8>RemoteNode3D.cpp
8>RemoteNode3DSub.cpp
8>RemoteNode3D.cpp(59): warning C4018: '<': signed/unsigned mismatch
8>RemoteNode3D.cpp(197): warning C4018: '<': signed/unsigned mismatch
8>UIActionButtons.cpp
8>UIActions.cpp
8>UIAmount.cpp
8>UIAttributes.cpp
8>UIAvatar.cpp
8>UIAvatarCreateWizard.cpp
8>UIBuy.cpp
8>UIChat.cpp
8>UIConfirmPopup.cpp
8>UIDownloadBar.cpp
8>UIGuild.cpp
8>UIGuildCreate.cpp
8>UIGuildHallBuy.cpp
8>UIInventory.cpp
8>UILoadingBar.cpp
8>UILogin.cpp
8>UILootList.cpp
8>UIMail.cpp
8>UIMailCompose.cpp
8>UIMainButtonsLeft.cpp
8>UIMainButtonsRight.cpp
8>UIMiniMap.cpp
8>UINewsGroup.cpp
8>UINewsGroupCompose.cpp
8>UIObjectContents.cpp
8>UIObjectDetails.cpp
8>UIOnlinePlayers.cpp
8>UIOptions.cpp
8>UIPlayerDetails.cpp
8>UIPlayerOverlays.cpp
8>UIQuests.cpp
8>UIRoomEnchantments.cpp
8>UIRoomObjects.cpp
8>UISkillDetails.cpp
8>UISkills.cpp
8>UISpellDetails.cpp
8>UISpells.cpp
8>UISplashNotifier.cpp
8>UIStatChangeWizard.cpp
8>UIStats.cpp
8>UIStatusBar.cpp
8>UITarget.cpp
8>UITrade.cpp
8>UIWelcome.cpp
8>Application.obj : /DEBUG:FASTLINK is not supported when managed code is present; restarting link with /DEBUG:FULL
8>LINK : fatal error LNK1256: ALINK operation failed (80040436) : Error signing assembly -- Access is denied.
8>Done building project "Meridian59.Ogre.Client.vcxproj" -- FAILED.
========== Build: 8 succeeded, 1 failed, 2 up-to-date, 1 skipped ==========
cyberjunk commented 6 years ago

I haven't seen this problem before.

It seems your build fails at the very end when it tries to sign OgreClient using the included SNK Key-File in the repo. However, the signing is not really required for debug-builds...

Have you tried just disabling it?

Open the OgreClient project properties, go th to "Linker" settings and remove the KEYFILE entry there which points to:

..\Meridian59\Meridian59.snk

I assume this is either a bug in your current VS version or a system-specific error. Can you post your exact VS 2017?

NHuebner1983 commented 6 years ago

Disabling the Key File did the trick for debug x86. Also, when I take the debug EXE and use it in place of where the downloaded EXE is, when I login all of the graphics have black backgrounds around them and I can see white lines (like the matrix) It's pretty trippy! Is this normal for debug mode?

Microsoft Visual Studio Community 2017 (VS2017) Version 15.5.6 VisualStudio.15.Release/15.5.6+27130.2027 Microsoft .NET Framework Version 4.7.02556

Installed Version: Community

Visual Basic 2017 00369-60000-00001-AA854 Microsoft Visual Basic 2017

Visual C# 2017 00369-60000-00001-AA854 Microsoft Visual C# 2017

Visual C++ 2017 00369-60000-00001-AA854 Microsoft Visual C++ 2017

ASP.NET and Web Tools 2017 15.0.31127.0 ASP.NET and Web Tools 2017

JavaScript Language Service 2.0 JavaScript Language Service

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

NuGet Package Manager 4.5.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Syntax Visualizer 1.0 An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

cyberjunk commented 6 years ago

Also, when I take the debug EXE and use it in place of where the downloaded EXE is, when I login all of the graphics have black backgrounds around them and I can see white lines (like the matrix) It's pretty trippy! Is this normal for debug mode?

Yes it's normal, that's why it's called a debug build :-) The white lines show the so called "bounding box" of the object. The black background is useful to debug the 2D object images.

If you build Release, this will be gone.

NHuebner1983 commented 6 years ago

Haha I knew you would say that! :) So it's built, that's a good start. I am glad it's working.

Do you play on 112? There were 49 people on yesterday. I think this is where everyone is at now. I told my friend I wouldn't come back and play unless I could play with the source code first.

Is the error I was receiving due to the VS 2017 Upgrade 3 ? Or maybe I need to install something else?

NHuebner1983 commented 6 years ago

Here are my available SDK Versions:

10.0.16299.0 10.0.15063.0 10.0.14393.0 10.0.10586.0 8.1

cyberjunk commented 6 years ago

BTW:

Also, when I take the debug EXE and use it in place of where the downloaded EXE

You don't need to do this. You can run OgreClient from VisualStudio directly with debugger attached using the VS play button. But you need to do 2 things before:

1) Open the project-settings of OgreClient, go to "Debugging" and set the "Work Path". For x86 debug it'd be: bin\x86\Debug\ For x64 debug it'd be: bin\x64\Debug\ These are also the folders that the EXE file is built into.

2) Copy the contents of folders 'bgfobjects' and 'bgftextures' from the OgreClient installation into the repository folders (both in subfolder /Resources)

Do you play on 112? There were 49 people on yesterday.

112 and 105 are running the same variant of the game which is also the one this repository here is targetting by default. I have toons on 112 since it opened, but I don't really play regularly right now.

NHuebner1983 commented 6 years ago

Ok thank you for that info :) I have been using the Local window debugger. Seems I am getting the hang of running M59. I also got all of the Resources loaded.

Great job, thank you!

NHuebner1983 commented 6 years ago

Cyberjunk,

Help -- I'm still stuck! I can only run Debug x86.

I can't build:

Release x86 Release x64 Debug x64

BUT - I can build Debug x86.

I finished my edits in the game, but I want to use the EXE without the Grids / black boxes that Debug Mode turns on.

How can I fix the ALINK errors?

cyberjunk commented 6 years ago

I can't build: Release x86 Release x64 Debug x64

Apply the same work-around as for debug x86 that is mentioned above:

Open the OgreClient project properties, go th to "Linker" settings and remove the KEYFILE entry there which points to:

..\Meridian59\Meridian59.snk

You need to do this 4 times on all 4 combinations of x86/x64 and debug/release.

Otherwise I expect this to be issue related to your system setup. Nothing I can fix. It's working fine for several people including the build-server that produces 105/112 binaries.

I noticed that you built somewhere on your system drive directly:

C:\M59_ALL\

May be you try running Visual Studio as Administrator or you make sure that: a) Your user is member of administrators group b) Your user has full access to that folder and all subfolder c) Try disabling UAC

Hope that helps, otherwise just use the workaroud, there is like zero difference whether the assembly is signed or not, especially if it's your custom one.

NHuebner1983 commented 6 years ago

yes!!!! YES!!!!

It's alive! It's aLIVE!!!!!

Running VS 2017 As Administrator fixed the Access Denied Issue.

<3

Thanks man!!!