Signing Assemblies - wrong key file path
2 posts • Page 1 of 1
Signing Assemblies - wrong key file path
Hi, I'm getting the error "error PS0033: [ILASM] Failed to open key file" in the output window of VS after the postsharp.exe call, during the build process.
The problem happens when the snk file is specified using relative path.
[assembly: AssemblyKeyFile(@"..\..\..\SolutionItems\mykey.snk")]
If I use an absolute path it works fine.
I use the following file system structure for my solution
C:\somefolders\trunk\mysolution.sln
C:\somefolders\trunk\SolutionItems\mykey.snk
C:\somefolders\trunk\SolutionItems\othersolution.item
C:\somefolders\trunk\MyProject1\project1.csproj
C:\somefolders\trunk\MyProject2\project2.csproj
C:\somefolders\trunk\MyProject3\project3.csproj
and so on... and I specify the path for the snk file as
[assembly: AssemblyKeyFile(@"..\..\..\SolutionItems\mykey.snk")]
so it doesn't matter where I have trunk folder it always build because the output dir is always three dirs deep from the trunk folder "\MyProject1\bin\Release".
From the output window I can see the path of the snk file passed as argument to ilasm.exe is wrong, it is:
"C:\somefolders\trunk\MyProject1\obj\Before-PostSharp\Release\..\..\..\SolutionItems\mykey.snk"
this path misses a '..\' to compensate the intermediate folder 'Before-PostSharp' which is placed between the obj folder and the Release/Debug folder
I would like to know if there is a way to fix this path without code an absolute path for the snk file.
Thanks in advance,
-fred
The problem happens when the snk file is specified using relative path.
[assembly: AssemblyKeyFile(@"..\..\..\SolutionItems\mykey.snk")]
If I use an absolute path it works fine.
I use the following file system structure for my solution
C:\somefolders\trunk\mysolution.sln
C:\somefolders\trunk\SolutionItems\mykey.snk
C:\somefolders\trunk\SolutionItems\othersolution.item
C:\somefolders\trunk\MyProject1\project1.csproj
C:\somefolders\trunk\MyProject2\project2.csproj
C:\somefolders\trunk\MyProject3\project3.csproj
and so on... and I specify the path for the snk file as
[assembly: AssemblyKeyFile(@"..\..\..\SolutionItems\mykey.snk")]
so it doesn't matter where I have trunk folder it always build because the output dir is always three dirs deep from the trunk folder "\MyProject1\bin\Release".
From the output window I can see the path of the snk file passed as argument to ilasm.exe is wrong, it is:
"C:\somefolders\trunk\MyProject1\obj\Before-PostSharp\Release\..\..\..\SolutionItems\mykey.snk"
this path misses a '..\' to compensate the intermediate folder 'Before-PostSharp' which is placed between the obj folder and the Release/Debug folder
I would like to know if there is a way to fix this path without code an absolute path for the snk file.
Thanks in advance,
-fred
- fred
- Posts: 1
- Joined: Thu Sep 04, 2008 2:55 am
- First Name: Freddy
- Last Name: Gomez
Re: Signing Assemblies - wrong key file path
It is a bug, so please report it in the issue tracker.
Thanks!
-g
Thanks!
-g
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
2 posts • Page 1 of 1
