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. How to use sgen.exe in postbuild events

How to use sgen.exe in postbuild events

Scheduled Pinned Locked Moved C#
questionhelptutorial
5 Posts 3 Posters 0 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.
  • R Offline
    R Offline
    Razvan Dimescu
    wrote on last edited by
    #1

    I have to use SGEN on an strongly named assembly that uses XmlSerializer

    "sgen.exe" //program that creates a serializer assembly
    "$(TargetPath)" //location of the assembly that uses the serilizer
    /f //override serializer assembly
    /out:"$(TargetDir).." //output location of the serializer dll
    /compiler:/keyfile:"d:\new folder\outlookSyncSign.snk" //location of strong name key

    The problem is that if the folder where the strong name key file has spaces the command will be unsuccessful. How can I overcome this without changing the name of the folder where the strong name resides?

    R E 2 Replies Last reply
    0
    • R Razvan Dimescu

      I have to use SGEN on an strongly named assembly that uses XmlSerializer

      "sgen.exe" //program that creates a serializer assembly
      "$(TargetPath)" //location of the assembly that uses the serilizer
      /f //override serializer assembly
      /out:"$(TargetDir).." //output location of the serializer dll
      /compiler:/keyfile:"d:\new folder\outlookSyncSign.snk" //location of strong name key

      The problem is that if the folder where the strong name key file has spaces the command will be unsuccessful. How can I overcome this without changing the name of the folder where the strong name resides?

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      try reating a batch file, then run the batch file from the post build event. You could pass in the target path and the output location if necessary, or just "hard code" them in the batch file...

      R 1 Reply Last reply
      0
      • R Razvan Dimescu

        I have to use SGEN on an strongly named assembly that uses XmlSerializer

        "sgen.exe" //program that creates a serializer assembly
        "$(TargetPath)" //location of the assembly that uses the serilizer
        /f //override serializer assembly
        /out:"$(TargetDir).." //output location of the serializer dll
        /compiler:/keyfile:"d:\new folder\outlookSyncSign.snk" //location of strong name key

        The problem is that if the folder where the strong name key file has spaces the command will be unsuccessful. How can I overcome this without changing the name of the folder where the strong name resides?

        E Offline
        E Offline
        Ed Poore
        wrote on last edited by
        #3

        If you put the path in quotes then you shouldn't have a problem.

        R 1 Reply Last reply
        0
        • E Ed Poore

          If you put the path in quotes then you shouldn't have a problem.

          R Offline
          R Offline
          Razvan Dimescu
          wrote on last edited by
          #4

          as you can see in my post, the path is in quotes, it seems, according to this guy that's is a bug in sgen tool here I tried using a batch file but i get the same result

          1 Reply Last reply
          0
          • R Rob Graham

            try reating a batch file, then run the batch file from the post build event. You could pass in the target path and the output location if necessary, or just "hard code" them in the batch file...

            R Offline
            R Offline
            Razvan Dimescu
            wrote on last edited by
            #5

            it seems i get the same result using the batch file also, this is what i placed in the batch file "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" "c:\myApp.exe" /f /out:"d:\new folder" /compiler:/keyfile:"d:\new folder\myAppsnk.snk" I found this post And they it's a bug with sgen but i'm not sure i understood the workaround

            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