Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Managed C# Compiler question

Managed C# Compiler question

Scheduled Pinned Locked Moved C#
questioncsharp
6 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LongRange Shooter
    wrote on last edited by
    #1

    I am trying to get an assembly compiled using the managed compiler and get the resulting class library strong named. First I tried an explicite path to the file in the assembly. No go. :(( Now: the assembly info states that the strong name key must be relative to the project location....so I created the location in the assembly file as ..\..\keyfilename.snk and tried to have it find it. I first tried just locating the strong name key file within the source files and then in the bin file and in both cases the key file is reported as not found by the compiler. So next I added the path to my source in the /lib: switch for the compiler. This still ended with file not found. :(( Has :rose: anyone :rose: gotten a strong named compilation using the managed compiler and how did you get it to find the snk file ??? :confused::confused::confused: I am at wits end. :eek: Thanks, MJ _____________________________________________ The world is a dangerous place.
    Not because of those that do evil,
        but because of those who look on and do nothing.

    R L 2 Replies Last reply
    0
    • L LongRange Shooter

      I am trying to get an assembly compiled using the managed compiler and get the resulting class library strong named. First I tried an explicite path to the file in the assembly. No go. :(( Now: the assembly info states that the strong name key must be relative to the project location....so I created the location in the assembly file as ..\..\keyfilename.snk and tried to have it find it. I first tried just locating the strong name key file within the source files and then in the bin file and in both cases the key file is reported as not found by the compiler. So next I added the path to my source in the /lib: switch for the compiler. This still ended with file not found. :(( Has :rose: anyone :rose: gotten a strong named compilation using the managed compiler and how did you get it to find the snk file ??? :confused::confused::confused: I am at wits end. :eek: Thanks, MJ _____________________________________________ The world is a dangerous place.
      Not because of those that do evil,
          but because of those who look on and do nothing.

      R Offline
      R Offline
      Robert Hinrichs
      wrote on last edited by
      #2

      theRealCondor wrote: ..\..\keyfilename.snk AssemblyKeyFile("..\\..\\mykey.snk") Is it that simple a problem?

      L 1 Reply Last reply
      0
      • L LongRange Shooter

        I am trying to get an assembly compiled using the managed compiler and get the resulting class library strong named. First I tried an explicite path to the file in the assembly. No go. :(( Now: the assembly info states that the strong name key must be relative to the project location....so I created the location in the assembly file as ..\..\keyfilename.snk and tried to have it find it. I first tried just locating the strong name key file within the source files and then in the bin file and in both cases the key file is reported as not found by the compiler. So next I added the path to my source in the /lib: switch for the compiler. This still ended with file not found. :(( Has :rose: anyone :rose: gotten a strong named compilation using the managed compiler and how did you get it to find the snk file ??? :confused::confused::confused: I am at wits end. :eek: Thanks, MJ _____________________________________________ The world is a dangerous place.
        Not because of those that do evil,
            but because of those who look on and do nothing.

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Just put every thing in the same directory and change the assembly.cs file to point to the current directory. :) I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02

        L 2 Replies Last reply
        0
        • L leppie

          Just put every thing in the same directory and change the assembly.cs file to point to the current directory. :) I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02

          L Offline
          L Offline
          LongRange Shooter
          wrote on last edited by
          #4

          lippie, I had put the snKey file, and source files in one directory, and set [assembly:AssemblyKeyFile("")] to the same directory name. RESULT: key file could not be found I had put the snKey file and source files in one directory and set [assembly:AssemblyKeyFile("..\\..\\keyfile.snk")] RESULT: key file could not be found I had put the snKey file in the build directory and set the [assembly:AssemblyKeyFile("..\\..\\\\keyfile.snk")] RESULT: key file could not be found I had put the snKey file in the build directory and directly pointed at the build directory RESULT: key file could not be found I added a compile parameter /lib:"my souce library path" RESULT: key file could not be found I am about to put a shotgun in the mouth of the compiler and let it try and find it's brains after I pull the trigger !!!!! I suspect that the little tidbit in AssemblyInfo where it goes after %Project Directory%\obj\ that I am either a) not getting %Project Directory% set or b) I am still missing a directive to the compiler (which still goes back to a). _____________________________________________ The world is a dangerous place.
          Not because of those that do evil,
              but because of those who look on and do nothing.

          1 Reply Last reply
          0
          • R Robert Hinrichs

            theRealCondor wrote: ..\..\keyfilename.snk AssemblyKeyFile("..\\..\\mykey.snk") Is it that simple a problem?

            L Offline
            L Offline
            LongRange Shooter
            wrote on last edited by
            #5

            Robert, I was shothanding here. if ..\.. was actually entered into the assemblyinfo file, it would fail with a compile error and never attempt to compile the dll since \. is an invalid control character. _____________________________________________ The world is a dangerous place.
            Not because of those that do evil,
                but because of those who look on and do nothing.

            1 Reply Last reply
            0
            • L leppie

              Just put every thing in the same directory and change the assembly.cs file to point to the current directory. :) I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02

              L Offline
              L Offline
              LongRange Shooter
              wrote on last edited by
              #6

              I finally got the managed compiler to create a strong named assembly. What I had to do was as follows: 1) I did a File.Copy to move the SN Key from the selected directory to the source directory. This was my choice but not necessary. 2) Instead of setting [AssemblyKeyName...] I had to set [AssemblyKeyFile... and specified the fully qualified path. [AssemblyKeyFile="D:\myApp\mySource\keyF.snk"] 3) Compile to your hearts content!!!! WOOHOO! _____________________________________________ The world is a dangerous place.
              Not because of those that do evil,
                  but because of those who look on and do nothing.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups