verifiable DLL

  • Thread starter Thread starter kent
  • Start date Start date
K

kent

Hi,

I'm trying to build a verfiable DLL using Visual Studio C++ 2005. I've
applied the /clr:safe, /CLRIMAGETYPE:SAFE and /noentry options. The
code is:

// TestRobot.h
#include "stdafx.h"

#pragma once

using namespace NRobot::Robot;

[assembly:RobotClass("NRobot.MyName.MyRobot")];

namespace NRobot {
namespace MyName {
[OwnerEmail("(e-mail address removed)")]
[TeamInfo(Name="My Team2", BodyColor=0xffff00)]
[RobotInfo(1, Name="My Robot")]
public ref class MyRobot : public IRobot {
public:
virtual void Start(StartState ^state) {
}
virtual void Tick(TickState ^state) {
state->MoveSpeed = 10;
state->TurnSpeed = 10;
state->Fire();
}
};
}
}

But the output DLL dosen't seem to be right. It won't load in an
application domain with restricted privileges (The C# version of the
same code works fine). Any idea?

Thanks in advance!
 
Are all source files in your project compiled with /clr:safe?

Marcus
 
1. What does peverify.exe tells you when run on the assembly?
2. Where do you load the assembly from and what exception is threre thrown
on you when you load the assembly in the partial trusted AD?

Willy.

| Hi,
|
| I'm trying to build a verfiable DLL using Visual Studio C++ 2005. I've
| applied the /clr:safe, /CLRIMAGETYPE:SAFE and /noentry options. The
| code is:
|
| // TestRobot.h
| #include "stdafx.h"
|
| #pragma once
|
| using namespace NRobot::Robot;
|
| [assembly:RobotClass("NRobot.MyName.MyRobot")];
|
| namespace NRobot {
| namespace MyName {
| [OwnerEmail("(e-mail address removed)")]
| [TeamInfo(Name="My Team2", BodyColor=0xffff00)]
| [RobotInfo(1, Name="My Robot")]
| public ref class MyRobot : public IRobot {
| public:
| virtual void Start(StartState ^state) {
| }
| virtual void Tick(TickState ^state) {
| state->MoveSpeed = 10;
| state->TurnSpeed = 10;
| state->Fire();
| }
| };
| }
| }
|
| But the output DLL dosen't seem to be right. It won't load in an
| application domain with restricted privileges (The C# version of the
| same code works fine). Any idea?
|
| Thanks in advance!
|
 
Willy said:
1. What does peverify.exe tells you when run on the assembly?

c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>peverify
"c:\Documents a
nd Settings\kent\My Documents\Visual Studio
2005\Projects\TestRobot\Debug\TestRo
bot.dll"

Microsoft (R) .NET Framework PE Verifier. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

All Classes and Methods in c:\Documents and Settings\kent\My
Documents\Visual St
udio 2005\Projects\TestRobot\Debug\TestRobot.dll Verified.
2. Where do you load the assembly from and what exception is threre thrown
on you when you load the assembly in the partial trusted AD?
From a NET v1.1 C# EXE. I remember the exception is saying file not
found.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top