cancel
Showing results for 
Search instead for 
Did you mean: 

.NET PDK - Unable to build PAR file for EP deployment

Former Member
0 Kudos

Hi all,

I'm trying to deploy my first PDK for .NET component but experience an error. Following is the Output window content:

Build...

-


Build EP6Test : Done -


Handle Ascx Files ...

Invalid class name EP6Test.HelloWorld

Check that the portal component inherits an existing class.

-


Deployment failed. -


I did the dead simple Hello World walk-through to make sure there's no dependency-related issues. It seems like it isn't interpreting the DLL properly.

Some notes:

  • The project compiles successfully.

  • The HelloWorld.ascx file was created using the Add New Item -> Portal Component process

  • The Inherits attribute in the page directive and the Inherits statement in the code-behind appear correct.

  • This is a VB.NET project.

  • My development workstation, portal server and the .NET host are all on different machines. Given I can't build the PAR file to deploy, I don't think this is an issue, however I <b>do</b> have the Portal Runtime installed on my development workstation. I'm trying to deploy to the portal server.

Any help would be most appreciated.

Mal.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

A quick test you might want to try is to close all VS windows and do a "repair" on the PDK VS add-in installation... maybe something went wrong there (at least it seems like it).

Regards,

Ofer

Former Member
0 Kudos

Thanks Ofer, I tried this and I still have no luck.

I also tried changing the PAR file path to a different folder in case the problem's related to permissions (I'm a local admin on my machine so I don't think this would be a problem), but this also has no effect.

0 Kudos

Hi Mal,

Please create (again ) an empty project and check the following things:

1. At the project properties->common properties->General what is the [Root namespace] declared.

2. At the code behind of the new portal component created, what is the [Class name].

3. At the control directive in the html of the portal component, check that the Codebehind value is the exact name of the portal component file name. and the Inherits value is according to the values you saw previously [Root namespace].[Class name]

In order to work correctly it has to follow the restrictions above.

Regards,

Gaia

Former Member
0 Kudos

Thanks for your thoughts, Gaia. This was the first place I looked when I received the error, because it does seem to indicate a problem with the PAR packager trying to reference the control in the assembly.

The references all seem to be correct; I created a new project named PortalApplication2 and looked at the references in the default component PortalComponent1.ascx, and they are all correct:

- Project root namespace is PortalApplication2

- Class name in the code-behind is PortalComponent1

- The control directive refers to the correct codebehind PortalComponent1.ascx.vb and the Inherits attribute reads PortalApplication2.PortalComponent1.

What's perplexing is the project builds fine, and previews ok in the Display mode of the editor... it just can't create the PAR.

I tried creating a C# project, too, just in case it was something weird with VB but get the same result when building the PAR.

When I first tried to use the PDK I couldn't even create a project because of a DLL error. I found a posting elsewhere in the forums that mentioned registering a DLL (was it csproj.dll?) in COM; it has worked since doing this, but I'm concerned there's other things that haven't worked as they should. I've reinstalled the PDK but this hasn't fixed the problem.

Message was edited by: Mal Cartwright

0 Kudos

It might be a security issue, in order to check that please turn off temporarily the .NET security using Code Access Security Policy Tool (caspol.exe):

- Open a Visual Studio Command Prompt (Programs->Microsoft Visual Studio .NET 2003->Visual Studio .NET Tools->VS Command Prompt)

- Execute "caspol -s off".

- Try creating PAR again.

<b>important</b>: don't forget to turn on .NET security again later.

Former Member
0 Kudos

Good thinking, Gaia. I turned off code access security and it successfully built a PAR.

Now, so I don't have to leave all .NET security off, can you tell me what level of permissions are required on which assemblies so I can create a code access policy to get this working?

I don't understand why the installer for the PDK wouldn't set this up - it seems nobody else has this problem , so I guess it must be something to do with our environment where I work. We have domain-level group policies in place that could be preventing something, but given I'm a local administrator on my machine I suspect it may be something else. There's nothing in any Windows event logs to suggest a problem, so it seems like it's restricted just to .NET security.

Thanks for helping isolate the problem; if you can offer any assistance in rectifying the sitation I'd appreciate it.

Regards,

Mal.

Former Member
0 Kudos

Hi,

You can use the same tool to check assembly permissions (caspol -rsg assembly_name).

Check that you have permissions on 2 assemblies - 1 is the one that was just compiled from your test project and the other is SAP.Portal.Web.UI (which should be in the GAC and in the add-in installation folder).

It's possible that some domain settings are overriding your machine settings, preventing the PDK from working as it should.

(You can paste the results here if you are not sure)

Regards,

Ofer

Former Member
0 Kudos

The results of the SAP.Portal.Web.UI check are as follows:

Level = Enterprise

Code Groups:

1. All code: FullTrust

Level = Machine

Code Groups:

1. All code: Nothing

1.1. Zone - MyComputer: FullTrust

Level = User

Code Groups:

1. All code: FullTrust

and the results of my assembly are:

Level = Enterprise

Code Groups:

1. All code: FullTrust

Level = Machine

Code Groups:

1. All code: Nothing

1.1. Zone - MyComputer: FullTrust

Level = User

Code Groups:

1. All code: FullTrust

Given VS.NET's running on my local machine, I would have thought these assemblies all run under the MyComputer zone.

Any ideas?

Cheers

Mal.

Former Member
0 Kudos

These look ok.

Anyway, it is still obvious that something in the .NET security settings of your machine is set-up wrong - probably with regard to VS settings. This can be due to the fact that you or some domain admin or some program changed something, or something went wrong in the installation.

Maybe you can try to do this scenario on a different machine (preferably a "clean" one).

Regards,

Ofer

Former Member
0 Kudos

I was also receiving the same error when trying to create a PAR file and have also tried to "caspol -s off" my way out of the problem. I am definitely an administrator of the box and other admins can do it as well but when I run that command, I get the following message

"ERROR: Runtime error: Policy level User cannot be saved."

Any ideas?

Thanks,

Darryn

PS. I solved this problem. The issue (as I imagined) was the local security policy file was not in a proper location.

Message was edited by: Darryn Parker

Former Member
0 Kudos

Hi,

Did you add a new item to your project, or did you use the default one?

Could you post the html of your portal component please?

Anyway, just for checking, open a new SAP Portal Application project and try to build the par out of it without adding any code or contorls, were you successful?

About the portal sp, the problem you are facing is not related since the problem is in the development process and did not involve the portal not the .NET runtime. PDK.NET 1 patch 3 is no compatible with sp9 and you might experience some problems.

Former Member
0 Kudos

<!--%@ PortalComponent name="PortalComponent1" %-->
<%@ Control language="vb" Codebehind="PortalComponent1.ascx.vb" AutoEventWireup="false" Inherits="EP6Test.PortalComponent1"  targetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<LINK href= "C:Program FilesSAPPortal Add-in for Visual Studio 2003Controlsurur_design.css"	type="text/css" rel="stylesheet">
<body class="prtlBody" xmlns:sap="urn:http://schemas.sap.com/SAP.Web.UI.Controls">	
</body>

Thanks for your reply, Tsachi.

I have tried both - building and PARing from a new project with no code (using the default PortalComponent.ascx), as well as adding a new item (named HelloWorld.ascx as per the error message). In both situations, I get the error message with the PAR file won't build.

The ASCX HTML for the unedited solution is above. For some reason I couldn't put it in the body of my message because it dropped off all the text before the CODE section.

I agree the problem's not (yet) with the portal because I can't even deploy to it... I'm sure that will become another issue down the track, but I'm not concerned because we are applying SP12 to our sandpit environment.

Cheers

Mal.

Former Member
0 Kudos

Are there any logs in the event viewer, under the SAP node?

Former Member
0 Kudos

No, there are no Event Log entries either in the SAP or any other categories. I have also repaired the installation as Ofer suggested (I did this just after starting my PC before I loaded VS.NET) but it still doesn't work.

Former Member
0 Kudos

I've just learned that our portal is only patched to SP9 and I notice the doco for PDK Patch 3 is SP12 - is it likely/possible this would be the cause of my issue?