Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Wsp file created on development PC, the error on the server PC

$
0
0

Hi.

sorry i can`t english, but I must solve this problem, please teach me(i use translate)

I made webpart use SPServiceContext and UserProfileManager, that is no problem.

but, I made .Wsp my webpart -> try use wsp on the serverPC -> error

This problemoccursonly when you useSPServiceContext

made visual webpart ->use farm solution(not sandbox) -> ctrl + f5 -> no problem -> made .wsp ->  transfer .wspfile on the serverPC -> serverPC Sharepoint SiteSet(siteoption...sorry i don`t know english name) -> solution -> upload solution -> Activation -> add web part by sharepoint site -> error

this is my source

 using (SPSite site = new SPSite("http://xxx-aaa:50000/"))
            {
                String skill = "";
                String[] abc = new String[10];
                SPServiceContext sContext = SPServiceContext.GetContext(site);
                UserProfileManager profileManager = new UserProfileManager(sContext);
                UserProfile u = profileManager.GetUserProfile("ms\\ms12345");
                for (int count = 0; u[PropertyConstants.Responsibility][count] != null; count++)
                {
                    abc[count] = u[PropertyConstants.Responsibility][count].ToString();
                    skill = skill + ", " + abc[count];

                }
                Label1.Text = skill;
            }

i want write english error message but i am using japaness, so used translate

webpart error -> Appdomain that ispartially trusted,unhandled exceptionwas thrownfrom the executionmethodofcodewrapperthat is protected bysecurity: Assembly: Microsoft.SharePoint, Version = 15.900.0.0, Culture = neutral, PublickKeyToken =71e9bce111e9429c.Windows can not load thetypeMicrosoft.Sharepoint.SPServiceContext

wait comment Thank you.



Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>