View previous topic :: View next topic |
Author |
Message |
Matt
Joined: 23 Jan 2011 Posts: 2
|
Posted: Sun Jan 23, 2011 4:37 am Post subject: Sample project for Visual Studio Express |
|
|
I have been attempting to use .NET Encryptor demonstration version with Visual Basic 2010 Express. The single biggest problem in trying to get the sample projects to work is the fact that the Express version of Visual Studio does not allow Build Events. It will, however, run any build events in an existing project. Since the sample project for VB2010 comes with a build event to create the encrypted version of the application being encrypted, Visual Studio runs this build event. There does not appear to be any way to turn the build event off.
I have figured out how to encrypt my application using the command line, which is not difficult at all. This encrypted file is then used as an input to the bootstrap project. What I a having great trouble with is making my own bootstrap project that does not have a build event and uses the .NET 4 version of the AssemblyLoader.
Would you please post a sample project for VB 2010 that 1) is only the bootstrap project and 2) is set up for .NET 4? This would be a huge help for me and I think fairly simple for you, since what I need is a minimally modified version of the sample project that comes with .NET Encryptor.
Thanks. _________________ Matt |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jan 24, 2011 6:08 am Post subject: |
|
|
The Visual Studio project files are actually just XML. So you can edit the .vbproj file in Notepad and simply delete the PreBuildEvent and PostBuildEvent elements. Note that this means that you can add build events to Express projects - you just have to add them to the project file manually. _________________ Infralution Support |
|
Back to top |
|
|
Matt
Joined: 23 Jan 2011 Posts: 2
|
Posted: Tue Jan 25, 2011 2:50 pm Post subject: |
|
|
I have discovered one other significant difference when working with Visual Studio Express. To save others the time it took me to figure this out, here is what I learned in summary:
1) Encrypt your application using the command line. This is explained well in the documentation.
2) In the bootstrap .vbproj file, delete or comment out the pre and post build events.
3) Place your encrypted assembly in the Assemblies folder in the bootstrap project. Just because the encrypted assembly is in the folder does not mean it is included in the project. The instructions in the sample project tell you to right click on the encrypted assembly and select "Include in Project". Unfortunately, this option does not exist in VS Express. To include the encrypted assembly, you must edit the .vbproj file for the bootstrap project to include the following text:
<ItemGroup>
<EmbeddedResource Include="Assemblies\TestApp.enc" />
</ItemGroup>
Of course "TestApp" becomes the name of your assembly. If you search the sample project "bootstrap.vbproj" file for this text, you can see it in the original sample project. _________________ Matt |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Jan 25, 2011 11:19 pm Post subject: |
|
|
Thanks for posting that. _________________ Infralution Support |
|
Back to top |
|
|
|