ActiveReports Upgrade Error - activereports

I just upgraded from ActiveReports 2.0 to 3.0. All rpx files have been converted to *.vb files. The ActiveReports project has this class hierarchy:
*.vb with designer -> PrintBase.vb -> ActiveReport3
When I opened any of the *.vb files, I got this error:
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: xxx --- The base class 'PrintBase' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Call stack:
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
Then I went through PrintBase.vb. There was no compile error. Then I modified one of the *.vb files to this:
Hello.vb -> ActiveReport3
The designer worked without any problems. The PrintBase has quite a bit of code. To simplify the debugging, I created a new .vb file called BasePrint that inherits from ActiveReport3. So, the hierarchy is back to:
Hello.vb -> BasePrint -> ActiveReport3
Then I saw the same error above again. It seems like AR3 designer does not allow .vb files to inherit from a base class according to my debugging. But I am not quite sure. BTW, the ActiveReports project is vb.net. There are other C# projects under a VS 2008 project solution. Is the mixing of VB.NET projects and C# have anything to do the miagration / upgrade process?
Thanks.

Indeed, the class-style inheritance was not supported by the upgrade utility in the ActiveReports 3.x designer. However, after an upgrade is complete you should be able to put the base class bad (the way that you described) and the designer should safely ignore it. If you're still having problems try to close the project, do a clean (delete the old assemblies that might be referncing the old PrintBase class) & close visual studio and reopen it again to get a fresh start.
You can find more information about upgrading reports from ActiveReports 2.x to ActiveReports 3.x at the following page: link text
However, it seems you are using inheritince in this case to share some utility methods and maybe some state (e.g. in class-level fields maybe). For this it is best if you have your reports inherit directly from ActiveReport3 and use "BasePrint" as a sort of utility class that your reports call functions in. Normally this has no disadvantage other than having to prefix the method calls with the name of the corresponding BasePrint instance/variable name and it simplifies dealing with ActiveReports designer in the scenario you describe.
However, ActiveReports does support a visual inheritence that allows a base report to share controls with a derived report. There is more information on how to use this feature at the following location: http://www.datadynamics.com/Help/ARNET3/ar3tskInheritance.html. However, I want to stress that this is a different style of inherience than you are using so it may not be applicable to what you need.
Also, you should try to convert again without having a combined solution with C# and VB projects. I don't know that this is a problem but it is certainly not the most common way the converter is used and may be complicating things.
Finally, you should be aware that ActiveReports 6 is now available and you may want to consider trying out that version.
If you continue to have any problems please contact our support team at support#grapecity.us.com or use our public forms that have many ActiveReports experts monitoring them every day at the following links:
http://www.datadynamics.com/forums/73/ShowForum.aspx - ActiveReports 3 Forum
http://www.datadynamics.com/forums/82/ShowForum.aspx - ActiveReports 6 Forum
Scott Willeke
GrapeCity / Data Dynamics

Related

.NET Standard 2.0 / EntityFrameworkCore / DB2 / IBM.EntityFrameworkCore issue

Does anyone here has experience with IBM.EntityFrameworkCore package? I've created a .NET Standard 2.0 library project in VS2017, added mentioned package, and tried to make it work by following this and this tutorial from IBM website, with no luck. I get the project compiled, but at the runtime I'm getting a System.TypeLoadException with the following message:
Method 'ApplyServices' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.1.1.101, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
Any help will be appreciated!
Thanks!
Update: The exception happens as soon as I try to use the context. It means after the context is successfully created, but before DbContext.OnConfiguring call happens.
I've solved it. It turned out that this exception happens if actual entity types (i.e. MyType) aren't defined in the same assembly (project) as the context. In my solution I had entity types defined in one project, and DbContextdefined in a different project, that references the first one, of course.
The reason for me to have such design was in the fact that there are two different packages (depending on the actual OS): IBM.EntityFrameworkCore and IBM.EntityFrameworkCore-lnx. So I've created two different projects, each referencing one of these packages. Still, I wanted to have all the entity types defined once... But obviously it cannot work like that.
Update: Sadly, it turned out that this isn't the only issue. I've ran into another one, described here. Thumbs down for DB2 .NET team! It's always frustrating to work with...

Are there any alternatives to T4 templates and EnvDTE for cross platform asp.net 5 development?

We currently use T4 templates to generate C# code files based on C# Code (Entity POCO's) and the EDMX (in older applications)
Moving to ASP.NET 5 with a view to support cross platform development, are there any code generation tools available that can read a projects class & meta data structures, and to generate C# files at design time, similar to T4 templates?
You can try Scripty - it is Roslyn based scripting.
Syntax highlighting for *.csx files works out of the box;
VS extension exists to process scripts on save;
MSBuild task exists to process scripts during buld process;
Script allows you to traverse a hierarchical model of the project;
Multiple files generation from single script is supported;
yeoman seems to be a good option. There exist some generators already for scaffolding asp.net 5 apps and you can create your own generators
It is cross platform and can be used on linux/mac/windows.
Even tt templates weren't supported earlier in asp.net-5 projects. It has been added recently (in Visual Studio 2015 Update 1).
The discussion is here: https://github.com/aspnet/Home/issues/272
And in the thread, Eilon said the Roslyn is the way to analyse the code and generate new ones... And he again said the ASP team has no immediate plan. So currently we have no solution from Microsoft.
But I did some search and didn't find any cross platform community tool to generate codes based on other codes. :(
Scriban worked for me as an alternative to replace T4 templates for generating unit test code. But it's a pure templating engine.
The new LeMP preprocessing engine for C# can be used as an alternative to T4 templates. May I ask what specifically you mean by "projects class & meta data structures"?
For this purpose I created a simple python
script called "autogen".
How it works: the script takes jinja template file (instead of T4) and data file (json) and generates one or multiple output files (e.g. C#, or any format) based on the template.
How it can be used (example): describe interface (methods, parameters) definition in json file, create *.j2 template files for C#, Java, Python, etc.. Then run autogen.py script and files for proxy/stub for all languages will be created.
This can help to create lot of similar code without copy/pasting and make code changes by simply changing single json file.
Moreover it can be integrated with build pipiline, msbuild (.net, .net core) and is cross-platform.
I have been looking into this same sort of thing, although not specifically with ASP.NET MVC but across project types as I move to .Net Core. I kept my T4 relying on EDMX early on. Which works out since EF7 moves beyond the file format in favor of code. Where I was planning on going with my code generation was a combination of ScriptCS and C# REPL. Roslyn complicates things for me a tad since there are no design time assemblies from what I understand. So the trick may be to understand and introspect cs files from within the project.

Migrating TFS 2012 to VSO - Template Issues

I am attempting to migrate from an on-premise installation of TFS 2012 to Visual Studio Online. I have a handful of projects that have been in existence since TFS 2005 and have been upgraded/migrated up to 2012. Only one of those projects has any significant work item activity that I really need to maintain.
That project is using the MSF for Agile Software Development 6.2 template. I have never made any customizations to the template to my knowledge over the years. However, since it has been upgraded / migrated I am not surprised that the template is causing the OpsHub utility issues.
For every Work Item Type in the project, the fields 'Area Id' and 'Iteration Id' show as red errors on the validation screen of the tool for this specific project.
I have already tried the solutions suggested here, but it seems to have made no difference whatsoever. The template on VSO is MSF for Agile Development 2013.3. After looking at the WIT definition files in that template I can see that there is no 'Area Id' or 'Iteration Id' fields (or 'AreaID' or 'IterationId' for that matter) defined. However, in the 6.2 templates that field is specifically defined.
I am sure this has something to do with those being System defined fields and no longer needing to be defined in the individual work item templates or something of that nature. The fields cannot be deleted because they are System fields.
In any case, I have not been able to find a solution to this problem so that I can complete running the OpsHub tool to migrate this main project over. Any help would be greatly appreciated.
As an aside, every one of my projects are showing 'Template Customization or Template Mismatch' errors. For the meantime, I am just trying to resolve the issues with this one main project. I may be able to forego migrating the Work Item Data for some of the other projects.
Thanks in advance!!!
In the move from 2008 to 2010 Microsoft changed a number of the built in fields. These fields do not appear in the template, but if you export the work item type from the instance of the process template you will see them.
Effectively an upgraded server has built in fields that never changed and the OpsHub tool craps out on fields that it should be ignoring.
The only solution, bar OpsHub fixing it, would be to try and change the field names to match what is expected.
You can use the witadmin.exe to make the change.

Visual Studio 2013 and Entity Framework

I'm using VS 2013 and SQL Svr 2012 and trying use EF to populate a gridview. As this is a very simple test, I have just one table with a key and a couple of data fields. The process of creating the model seems to work fine - it shows as expected in the designer view, the files are created in app_code, a bin folder is created with 2 dlls, and the config file is updated with a connection string and other entries.
When I try to select the "named connection" I get the error "Unable to load the specified metadata resource" and it talks about rebuilding the project to get the assemblies.
I've spent hours reading other cases like this and I can't understand:
Why this is happening when it was never a problem with VS 2010
How do I fix the connection string to point to the resources it wants. I'm totally lost with all the technical advice about fully qualified assembly names - nothing I try works.
How do I set some parameter to force the resources to be in the proper place? All the advice I've read doesn't seem to relate very well with VS 2013
I need to decide if I should just uninstall VS 2013 and use VS 2012. Currently, I'm using VS 2010 with ASP 4.0 and I'd like to move to ASP 4.5 and generally keep up with Microsoft technology. However, I don't have the skill level to deal with a VS release that is buggy. It seems to me that this EF execise could be due to a either a bug or some odd corruption on my computer - I'm trying to figure out which is the case. I installed VS 2013 Express and SQL Svr 2012 on a clean machine that had none of these tools in the past.
I'd really like to see someone who is very familiar with Visual Studio try to replicate my problem as it only takes a few minutes to do so:
In MS SQL Server, create a tiny DB with one table that has a primary key and a couple of data fields and populate with some test data - Call it TinyDB with TestTable1.
Using VS 2013 Express for Web, create an "New Web Site" with the option for "ASP Empty Web Site" using VB.
Add an ASP App_Code Folder containing an "ADO.Net Entity Data Model" and leave the name as "Model".
Generate the model from the DB and make a "New Connection" for "TinyDB" and using Entity Framework 6.0 and then select "TestTable1". Note the namespace is "TinyDBModel". Clicking "Finish" will generate several items in App_Code, other folders and also update web.config.
Add a web form called default.aspx and drag a gridview onto it. In design mode for the gridview, select "new data source" and then the "Entity" option (note name of EntityDataSource1 which appears in default.aspx). Click next and under "named connection" select "TinyDBEntities" - this is where mine gets the error "Unable to load the specified metadata resource".
Note that this exact exercise in VS 2010 works perfectly and produces a grid with the correct data displayed.
Unfortunately, the EntityDataSource control does not work with the latest version of Entity Framework, EF6. Hopefully the control gets an update in a future update version of VS or EF, but for now you can't use the two together.
There are a few solutions / alternatives:
Drop back to EF 5. In order to do this, delete the .edmx and .tt files from the App_Code folder, delete the EF assemblies from the Bin folder, and remove the references to EF from web.config. Then rebuild the site, add a new ADO.NET Entity Model and choose version 5 in the Choose Your Version dialog. Then delete the .tt files from the App_Code folder, open the EDMX diagam, right-click an empty spot and on the Properties Grid set Code Generation Strategy to Legacy ObjectContext. Then rebuild again, and it should work.
Use Model Binding. This is really the recommended solution. The Microsoft / EF team recommends people to stay away from the EntityDataSource control and only use it for Dynamic Data web sites, Model Binding is the preferred solultion. It's pretty clean and straight forward to use, and gives you a lot of control over your queries and object updates. For more info about Model Binding, check out: http://www.asp.net/web-forms/tutorials/data-access/model-binding/retrieving-data

Multiplatform MSBuild project file

I'm currently working on a project which source code should be as portable as possible; that is, the project (in C#, but it is not very relevant) represent an application that should be executed on Android (with Mono-Android), on iPhone (with MonoTouch) and WinMobile (with official Compact Framework). Without going into details, the corresponding MSBuild solution consists of an independent-platform library (from a source code point of view, at least) which declare various interfaces and classes that represent an abstraction of each feature that is not common to the various platform (i.e. the UI). In addition, there are a corresponding library that specialize (for each platform) the "base library"; the effective application executable is a program that uses the abstraction and the common standard libraries.
Developing on WinMobile and Android is not really a problem: Mono-Android add-in can be installed on VS 2010, so both platforms can be handled with MS VS.
Initially the solution was created in VS, so the initial configuration and the related projects (Android and WinMobile) are automatically generated.
After that I've imported the solution in MonoDevelop under Mac (the only platform that is officially supported by MonoTouch), and I've created the project for the iPhone library; switching the configuration to generate the assemblies (iPhoneSimulator) the "base library" was not possible to compile due to a missing project type configuration; specifically, the GUID used by MonoTouch for <ProjectTypeGuids> is {E613F3A2-FE9C-494F-B74E-F63BCB86FEA6}; adding this GUID I can now compile "base library" in MonoDevelop.
The problem arises when I try to re-import the solution in VS: since there's no Windows version of MonoTouch, VS cannot find the add-in for the specified project type, and the project doesn't load.
Looking to the specifications of MSBuild project file, it seems that there are tons of options that cannot be set or modified within the project/solution editor in VS; however the format is quite complicated and now I'm asking your help!
Is there a way to specify in the project file that a project type is present only if a particular configuration is selected independently to which is the environment I'm using?
The general approach is something like this; a condition that progressivly builds your property, referencing any value the property already may have:
<ProjectTypeGuids
Condition="'$(BuildingInsideVisualStudio)' != 'true'"
>;{E613F3A2-FE9C-494F-B74E-F63BCB86FEA6}"</ProjectTypeGuids>
<ProjectTypeGuids>{OTHER-GUIDS-HERE}$(ProjectTypeGuids)</ProjectTypeGuids>
This will detect the VS condition (when building) and omit the unkonwn guid. I'm not sure however if it will work when the project is opened, this property might only apply to building. There may be a similar "sentinal" property for building on Mono, and you can reverse the condition.
I solved an unrelated, but very similar issue of cross-platform development by excluding the files that presented themselves as cranky when going between Linux and Windows. I have my project under source control and utilized that to keep things working cooperatively.
http://www.aydabtudev.com/2011/05/what-goes-into-source-control-android.html
It's not a 1-to-1 for your issue, but it might give you clues/ideas on how to solve your problem.