WCF ServiceClient Code Generation fails when types in Catel.Core dll are reused (including small example project) - catel

today I created a new Project, using Catel Framework in Silverlight.
However - I am facing a Problem when generating the service-Client for the WCF-Service in the silverlight Project.
To reproduce the issue:
- open solution,
build
"Show all files" in the Silverlight Project (CatelWCF.Problem)
Observe:
beneath node "WCFService" in Reference.cs - all Code generated successfully
now "configure service-reference" (right click "WCFService", Configure)
choose radio-button Option "Reuse types in all referenced assemblies", followed by OK (before it was configured to use all but Catel.Core)
Observe:
error-message in Error-List
view file "Reference.cs" - it is empty.
In WPF there is no Problem whatsoever, even if all assemblies are referenced. (CatelWCF.Problem.WPFClient Project)
Any ideas?
Johannes Colmsee
Update:
Sorry, the demo-Project can be downloaded here:
Demo
Update2: About why "observe" #1 Shows a succesfully generated file: "Catel.Core.dll" is explicitly excluded from referenced assemblies when you open the Project.

I narrowed down the Problem to one specific type in Catel.Core dll - Geert, please check what is wrong with this class:
Catel.Runtime.Serialization.Xml.XmlSerializationContextInfo
Regards
Johannes Colmsee
Update: Creating a sample Project with a (almost exact) copy of that class - no Problems.

Related

Clarion - Procedure params missing when importing APP into solution from APV

I'm new to Clarion and working on a task moving an existing project into Git.
I have used Clarion's internal tooling to export APP files to text (via Application > Export Application To Text). However, upon importing these .APV files back into Clarion, compilation breaks due to a myriad of errors. Tracing these errors led to the discovery (upon running a diff) that newly imported procedures were missing their parameter signatures.
The same symptoms occur when using Rick Martin's famous Upper Park VC tool via Upper Park VC > Save App to Version Control, as well as by right clicking on Solution Items in the Solution Explorer and selecting VC Getting Started > Test Export and re-Import APP Files.
Overall the question is, how can I modify my export/import process in order to preserve the solution state upon re-importing all APPs into Clarion?
Note: working in Clarion 10.
The issue is the APP file was originally from older version of Clarion and there is a bug in the import from text logic that does not properly handle prototype information in both the old and new format.
I updated the Upper Park VC tool to detect this condition and remove the old prototype format to resolve the issue.

Error: Cannot add the specified assembly to the global assembly cache:Select.Pdf.dll

I add licensed select.pdf.dll to my SharePoint project. This dll file has added in both the visual studio reference and the package section(Deploy target as 'Global Assembly Cache (GAC)').
I was not able to deploy my solution to my sharepoint development server, with the error message
“Error occurred in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache: Select.Pdf.dll.”
I have googled the problem, someone cannot deploy because the .dll they want to deploy already existed in %windir%\assembly folder and the .dll is locked by other process.
VS2015 build error: Cannot add the specified assembly to the global assembly cache
https://devramblings.wordpress.com/2011/03/23/error-cannot-add-the-specified-assembly-to-the-global-assembly-cache/
However, the "Select.Pdf.dll" I want to deploy has never been deployed before, the %windir%\assembly and %windir%\Microsoft.Net\assembly folders do not have same name dll. file in them.
I have tried to restart VS, and reset IIS. the problem still existed.
Is there any way to solve the problem? Thank you.
You need to add the relevant .dep files also. When you add your assembly to the advanced section of the package you can add Class Resources at the bottom of the dialog. In my case I had to add Select.Tools.dep and Select.Html.dep before I could deploy my sharepoint solution.
#Mundi's answer works, only clarification is that for us, only selecting Select.Html.dep was enough. It is to be noted that you have to specify that you want to view all files (not just .dll) when selecting the additional Class Resources.
Alternative solution that worked for development scenario (but not advisable for production) is using appropriate gacutil.exe to your .net version.

Visual Studio 2012 Signing

I would like to have Visual Studio sign my assemblies.
I got past the point where I can specify my PFX file without any complaints. That was not easy, as I had two of errors. Yes, I had to make sure that I used openssl (a stackoverflow article helped with that error) and a microsoft article helped with the first error message, where I had to import the PFX file, clear/set options, and then reexport to not include downstream certificates.
When I go to build a project, I receive the warning:
Option 'keycontainer' overrides attribute 'System.Reflection.AssemblyKeyNameAttribute' given in a source file or added module"
Naturally, my assembly did not get signed.
I did some research and the best suggestion that I saw was to add a line to the project file (did not help) or to sign stuff manually using a post build event, which I am now doing, but I would still like to get the sign tool to work.
I cannot imagine that Microsoft would offer the Singing tab, if the vast majority of developers would not be able to use the feature.
Heck, with the new Visual Studio 2012 Update 1 release, I would have expected that signing assemblies (DLLs or EXEs) would be child's play. The task is anything but.
Thoughts?
Without more information, I can't tell if this will fix your issue. But I'll post the answer that worked for me. In my case, I had converted an old project (pre VS 2012) that had specified signing in the AssemblyInfo.cs file like so...
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
I usually use the Signing tab in project/properties as you describe. The warning message was essentially saying "Hey, you already told me something different in the source code!"
The solution for me was to remove the above three lines in the AssemblyInfo.cs file.
I realize this is probably way after your original post but I hope someone finds it useful.

Visual Web Part with referenced DLL not checking GAC

I have a SharePoint project with a visual web part (WebPartA inherits from OtherWebPartC) - the web part references two DLL's, (ClassLibraryB and OtherWebPartC), and they are included in the package, set to be deployed to GAC.
When I deploy the project, the DLL's are successfully deployed to GAC, and the web part successfully shows up in the gallery in SharePoint.
However, when I try to add the visual web part (WebPartA) to a page, the page breaks - I enabled error display and stack trace - it says it can't find ClassLibraryB.dll. I used fuslogvw and procmon to determine that it was trying to load the DLL from typical locations (Virtual directory/bin, temporary asp.net folders), even though the DLL was not in these locations (but as I said, it was successfully deployed to GAC).
So I manually added ClassLibraryB.dll and OtherWebPart.dll to virtual directory/bin, and it worked successfully.
How do I get SharePoint to see the ClassLibraryB.dll and OtherWebPart.dll in the GAC? Or do I have to manually deploy the DLL to the site's Virtual Directory/bin?
Try to:
Change the WebPart/assemblies deployment target to "WebApplication" (instead of the GAC);
Retract the Solution and remove corresponding assemblies from the GAC;
Re-build and re-deploy the Solution together with the assemblies to the SharePoint Bin folder (the selected "WebApplication" deployment target).
Are all the necessary assemblies copied to the Bin folder? Does the Solution work in this case?
Just a heads up to all of you digging through these ancient questions...
I stumbled upon this issue today, so i decided to leave a comment in order to claridy things.
Most of the info can be taken from this great article by Waldek Mastykarz
Using the Project you would like to package the Controls project including the SafeControls entries.
Double click on the Package project item and the Package Designer will open.
In the Package Designer you click the Advanced button. In the Advanced view you click the Add button and choose the Add Assembly from Project Output (the options are different in VS17 but they are similar)… menu option.
From the Source Project dropdown list you choose your other Project.
Then in the Safe Controls section, you click the Click here to add a new item button to add a new Safe Controls entry.
Use the $SharePoint.Project.AssemblyFullName$ token so that you can specify that you want to include the fully qualified name of your assembly.

deploy an Application page of Sharepoint 2010 to another production server

How to deploy an Application page of Sharepoint 2010 to another production server.
I've created an Application page of Sharepoint 2010 inside the mapped layout folder. Everything works nicely now in Visual Studio 2010.
I can debug it after pressing F5, I can retract it and deploy it with Visual Studio 2010.
But when it comes to deploying it to another production server, I have tons of questions.
Basically I don't know how to deploy it to another production server. My first thought was just copy the pages to the Layout folder of IIS and register the referenced dlls. But after I studied a little bit of deployment, I feel my thought is ugly.
I tried "right clicking" on the project name and "package". The Visual Studio generates a "MyProjectName.wsp" in the bin folder. I used the central administration to upload this wsp file. But when I activate it, it raised an error saying "This solution contains invalid markup or elements that cannot be deployed as part of a sandboxed solution. Solution manifest for solution 'af2f9404-3b39-4f90-87f5-31e14b2f9a9a' failed validation, file manifest.xml, line 6, character 4: The element 'Solution' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'TemplateFiles' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'FeatureManifests, ActivationDependencies' in namespace 'http://schemas.microsoft.com/sharepoint/'." It seems that my application is not a sandbox, but I can't change it to a sandbox. Because when I do change it, the Visual Studio tells me "The deployment type "TemplateFile" of file "ApplicationPage1.aspx" in Project Item "Layouts" is not compatible with a Package in a Sandboxed Solution.
The Project Item "Layouts" cannot be deployed through a Package in a Sandboxed Solution.
Package validation failed."
Besides, even if I can successfully activate the .wsp file, I am not sure if the application page can be added to the Layout folder. Because I don't know how the .wsp file locate and find my application page? It doesn't have the page in it. Can anyone explain a bit on it?
Thanks for your answers.
1) It's strongly recommended that you use powershell to run your test and production deployments: http://dotnet.sys-con.com/node/1208275
2) Try changing your SharePoint solution to a farm solution and repackaging your wsp.
3) By right clicking on your project in visual studio and adding the mapped Layouts folder the solution packaging handles placing any application pages/user controls that you have in the appropriate directory inside your wsp.

Resources