I have a SharePoint webpart for which I have had to change its public key. However, I don't appear to be able to locate every reference to the old assembly signed with this key.
Now I get a 'Parser Error'...
Parser Error Message: Could not load file or assembly '[Assembly.name], Version=1.0.0.0, Culture=neutral, PublicKeyToken=[Old public key token]' or one of its dependencies. The system cannot find the file specified.
Can anyone advise me how I can trace what is referencing this assembly? I've deleted the instance of the web part on the page that is causing this error - what more can I do?
Thanks in advance,
Flippsie
Each webpart instance references the DLL explicitly. You can verify this by exporting the webpart and then opening up the file in a text editor. You'll see your DLL called out between the <Assembly></Assembly> node.
Try adding the webpart back to the page again. You may have to make a new DWP/.WEBPART file or update it in the Webpart gallery.
Related
We are working on a new feature that uses third-party plugins that are stored in a directory named 'Plugins'. One particular plugin expects certain files such as the license file to be in the same directory as the plugin assembly (DLL) based on the assembly's Location value. However, due to shadow copy the license file is in the folder where it was originally deployed and the assembly Location value is the 'Temporary ASP.NET Files' subfolder after shadow copy. Is there any way to disable shadow copy to work around this issue?
I suggested to the plugin provider to use CodeBase rather than Location. They are considering it, but I have to complete this feature now so I can't wait for that code change.
My current desire is to disable shadow copy so the Location property value of the assembly is the location where all the plugin files are initially deployed to.
Cause Azure Function doesn't support web.config, have to find other ways to implement it.
In github there is one way to solve it, and in this comment it says no shadowcopy in v2, maybe you could have a try. Add this directive in your Web Deploy pubxml for your publish profile:
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
We've recently created a second Company (id=3) based on a snapshot of our original company (id=2). I am attempting to publish a change to one of the Customization Projects in the new company. The file upload/save worked fine, but publishing leads to this error:
Publish Customization
Compiled projects: AA, BB, CC, DD
Validation has been started.
PX.Data.PXException: Cannot access the uploaded file. Failed to get the
latest revision of the file 9a65331c-ad34-477c-9759-2c414dead49f
at Customization.CstBinFile.GetFileFromDb()
at Customization.CstBinFile.SaveFiles(FilesCollection context)
at Customization.CstDocument.GetFiles(FilesCollection context)
at Customization.CstManager.ValidateDocument(CstDocument doc, Action`1
logMessageDelegate, Boolean patchLibInDB)
at PX.Customization.CstValidationProcess.ValidateCurrentDocument(Action`1
logMessage)
at PX.Customization.CstValidationProcess.CompileInternal()
at PX.Customization.CstValidationProcess.<>c__DisplayClass6_0.
<ProcessRequest>b__0()
This attempt represents the first publish within this Company.
I retried the upload/save, but still no luck.
Our version is: 6.10.0010.
How do I overcome this error?
Any help would be great. Thanks.
This can happen when the customization projects reference a file that has been removed from the database. Customization project still has the file reference ID but the database doesn't contain a file associated with that ID anymore.
If this is the cause of your error, you can correct it by removing and adding back missing files. To do this, go to the Files section of your customization project. Click on each file link.
If the file is missing in database, an error message popup will appear. For these, remove the file link reference and add it back again. When files are not missing, they will appear like in the screenshots below.
I have a customization project where I'm importing an Excel file content into the Lot/Ser No. Allocation grid. This works fine on my machine, but I had to download the DocumentFormat.OpenXml dll and include a reference in my class library project in order to do this. I've created a customization project, but when someone else tries to use it, that reference and that file are not there. I've tried to include it in the files section of the customization manager, but I have no way of doing that (can't browse to a file) - not that that would make any difference anyway, since that's the bin folder of the website, and not the class library.
Bottom line: Is there a way to include a dll file that's used in the class library project references in a customization package?
Add the dll file in Bin folder of your local website -> the file should appear in the Add Files dialog inside Customization Project Manager
Select the dll file in the Add Files dialog and click Save
After that, DocumentFormat.OpenXml.dll becomes a part of your customization package, which will always deploy it together with your extension library
Ruslan provided a good answer explaining how to include your custom DLL, however you might want to know that there are built in functions to read Excel files which make inclusion of third-party libraries unnecessary. Please refer to the following article: http://asiablog.acumatica.com/2016/03/reading-excel-file-acumatica.html?m=1
I'm following the tutorial here.
I created a new Web Application. I then added two Class Library projects, Common and Domain. The common project contains the SubSonic library while the Domain project contains the SubSonic .tt and .ttinclude files.
After modifying the settings in Settings.ttinclude, I try to 'Run custom tool' on the tt files and I get this error:
Running transformation: System.ArgumentNullException: Value cannot be null.
Parameter name: The project does not contain App.config or Web.config file.
I can provide the rest of the stack trace, but it appears that it can't find my Web.config which was the connection string. Adding an app.config to the Domain project just causes the generation step to complain about not finding expected sections.
Is there a way to have these files in a separate assembly but still use the web.config for settings?
You need to place an App.config in the project you want to generate from. Yes, it's redundant but there's no other way to handle this with T4
I am trying to create a subclass of WebPart that will act as a parent to any WebParts we create. If I create an empty class in the same project, I am able to inherit from it as one would expect. However, if I try to place it in another assembly -- one that I've been able to reference and use classes from -- I get the following error:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Other information that may be pertinent (I am not normally a SharePoint developer): I compile the dlls, reference them from the dev project, and copy them into the /bin directory of the SharePoint instance. The assemblies are all signed. I'm am attempting to deploy using VS2008's 'deploy' feature.
Unfortunately, this does not appear to be a SharePoint specific error, and I'm not sure how to solve the problem. Has anyone experienced this and do you have any suggestions?
OK, I found the problem. The packaging task uses reflection for some reason or another. When it finds that your class inherits from a class in another domain, it tries to load it using reflection. However, reflection doesn't do binding policy, so that domain isn't loaded.
The authors of the packaging program could solve this by adding the following code:
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);
Assembly a = System.Reflection.Assembly.ReflectionOnlyLoadFrom(filename);
static Assembly CurrentDomain_ReflectionOnlyAssemblyResolve(object sender, ResolveEventArgs args)
{
return System.Reflection.Assembly.ReflectionOnlyLoad(args.Name);
}
However, if you need a solution for your project, just add the assemblies to the GAC and it will be able to resolve them.