By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,601 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,601 IT Pros & Developers. It's quick & easy.

verifiable DLL

P: n/a
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("me@example.com")]
[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!

Mar 21 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Are all source files in your project compiled with /clr:safe?

Marcus

<ke**@cpttm.org.mo> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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("me@example.com")]
[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!

Mar 21 '06 #2

P: n/a
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.

<ke**@cpttm.org.mo> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
| 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("me@example.com")]
| [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!
|
Mar 21 '06 #3

P: n/a
Willy Denoyette [MVP] wrote:
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.

Mar 22 '06 #4

P: n/a
Yes, there is only a single source file.

Mar 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.