VS 2012 EF Designer View not updating Designer - visual-studio-2012

I am having a weird issue that seemed to come out of nowhere with Entity Framework v5 in Visual Studio 2012.
Today, I went to updated my model from my DB, because I added a new row column to a table. After updating it I saw the new column in the view, but when trying to reference it in the code I got errors. Turns out, the view was updated, but the Designer.cs class was not (I recreated the model). I tried this two more times and could not get the designer class to update.
I assumed it was an issue with the .edml file so I deleted it and recreated it. Now I am noticing that any changes I make in the view will not be reflected in the designer. I can change the namespace, tables, ect. and they will change in the view and the view only. I already re-added my references, but no luck. I am also getting connection issues now (which I am assuming are related to nothing but the view updating).
Has anyone else encountered this issue? I could always just go and edit the code on my own, but it is time consuming and less than ideal.

You should save the model (Ctrl+S or the Save button in Visual Studio) to regenerate the *.Designer.cs file (and other model files) after the model is changed.

Related

Acumatica: Procedure to rename a table in SQL without breaking screens, etc

I have a couple of custom tables I created and a few screens, imports, etc. based on them. Then realized I didn't prefix with our own 2 character tenant. Seemed like a simple refactor but If I rename SQL tables and the DAC classes (I'm using extension library) then my ASPX/Screen editor is broken (did not rename Graphs or Graph views) Tried to modify ASPX markup and reload changed files but then I wound up with an empty screen in screen editor. I'm putting everything back and restoring from previous day package export for now. Any tips/tricks for renaming SQL/DAC classes. I looked at PXTableName attribute (to try to keep code the same and only change SQL tables) but could not understand why that requires another virtual/abstract class.
Update: Tried again and this time no problems just renaming DAC and SQL table. Not sure what mistake I made the first time.

SSAS 2012 visual bug?

Has anyone else seen this? missing dsv
Normally when you are looking at a DIM in SSAS you have three sections to work in.
1) Attributes: These are the values you are including in your model
2) Hierarchys: If you build a hierarchy here is where it is viewed
3) Data Source View: This shows the source of the DIM and all the attributes loaded into the DSV are included.
Why is my DSV box empty?
I'm using TFS source control. I've deleted the local project and repulled the latest version but I'm still seeing this issue.
I'll submit an offical bug on microsoft's website.
If you have seen this how have you fixed it? I need to add new attributes to my DIM and I can't do that if I can't see the source table in the DIM...I'd prefer to not have to recreate ever DIM because of some bug.
I found a solution to this if anyone else comes across it. It has to do with having more than one version of Visual Studios installed on the server at a time and using different versions.
This article goes into detail on the issue. The article talks about changing the XLM code for the .dsv file and the .cube file. Specifically for the DIMs you will need to change the code there as well. Quite annoying...at least there is a way to fix it.
https://blogs.msdn.microsoft.com/sqlblog/2015/06/10/ssas-dsv-com-error-from-ssdt-ssas-design-data-source-view/
TLDR: VS 2012 and VS 2014 conflict with each other with their dll files. You will need to go into the XML code and change the leading binary string to the version of VS that you want to use.

Duplicate files in DerivedData folder using CoreData generator

I'm trying to generate NSManagedModels from my datamodel. Generation works but after I got many errors :
error: filename "Station+CoreDataProperties.swift" used twice:
'/Users/Me/MyApp/Models/CoreData/Station+CoreDataProperties.swift' and
'/Users/Me/Library/Developer/Xcode/DerivedData/MyApp-gwacspwrsnabomertjnqfbuhjvwc/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/DerivedSources/CoreDataGenerated/Model/Station+CoreDataProperties.swift'
:0: note: filenames are used to distinguish private
declarations with the same name
I try clean build folder and derivedData directory hard delete. I'm using Xcode 8 BETA maybe it's a bug ?
I get this in Xcode 8.1
For me following steps solved the issue. Please note that order matters.
1) Create entity in Core Data model.
2) Under class section, make settings as on following image.
Module: Current Product Name
Codegen: Manual/None
3) Generate your NSManagedObject subclass.
This post greatly helped me solve this problem myself. Personally I look at this as an Xcode bug. Bug or not this is a huge chicken and egg situation.
I ran into this by:
Created a new Project using Core Data
Generated my NSManagedObject subclass+extension (while codegen: ClassDefinition)
I accidentally saved the generated classes in the Wrong folder
I deleted the generated files
Re-generated in folder I wanted
đź’Ą- Xcode used twice errors
As others have posted I kept cleaning my build (and clean build folder) but that never fixed the build issue.
I finally figured out if you originally created your NSManagedObject generated classes with codegen: ClassDefinition, as I did without knowing then you are locked in for the chicken and egg issue.
I then deleted the auto generated classes thinking I had to re-generate, so I did. Once re-generated I would get the used twice build error again. I manually went into the ../DerivedSources/CoreDataGenerated/Model/.. and deleted the duplicates. Again, I re-generated thinking I'd only have 1 copy (in my project) but I was wrong. If codegen: ClassDefinition was originally set then Xcode will keep creating the auto-generated classes+extensions and put them in the buried folder ../DerivedSources/CoreDataGenerated/Model/... I repeated this chicken and egg a few times before catching on.
I later realized you do indeed need to mark codegen: Manual/None however to get things back in sync you need to delete the auto-generated files in ../DerivedSources/CoreDataGenerated/Model/.. and in your project if you have any there still.
Be careful setting codegen: Manual/None, for me it was bit tricky because codegen: Manual/None wouldn't stick. I had to click back and forth between entities multiple times to double/triple check each entity was set to codegen: Manual/None. Then auto generate the files. At this point your only copy of the auto generated files should be in your project and not in ../DerivedSources/CoreDataGenerated/Model/...
Last, I think this is a bug because if you specify codegen: Manual/None I don't expect Xcode to auto generate files at all, yet it does and puts them in your project. More confusing if your setting is codegen: ClassDefinition, who the heck knows Xcode will put the files in a buried directory yet it is available for use in your project. My beef with this is the auto generated files aren't source controlled and if I change computer I have to know to auto-generate them on the new station.
Hope this helps someone else!
Cheers!
This is indeed not a bug. As #Morrowless suggests both class definition and properties extension are created. If this is not wanted, select Manual/None under Codegen before generating the code. If the code is already generated, just delete them, and try Editor->Create NSManagedObject Subclass... again from the menu (after setting Manual/None).
Note, in the picture below, the Class Name 'Contact' is specific to my project. You will see your entity name instead.
If you generated CoreData subclasses with codegen: ClassDefinition your basically screwed. The only way to fix it is to:
Delete your CoreData subclasses.
Delete your derived data folder.
Clean your project (CMD+K).
Generate new CoreData subclasses, this time select Codegen: Manual/None and Module: Current Product Module
This is not a bug. Codegen generates these files in the DerivedData folder, so you don't need to create them again in your project, hence the compile error.
From Xcode 8.0 Release notes:
Xcode automatically generates classes or class extensions for the entities and properties in a Core Data data model. Automatic code generation is enabled and disabled on an entity by entity basis, and is enabled for all entities in new models that use the Xcode 8 file format. This feature is available for any data model that has been upgraded to the Xcode 8 format. You specify whether Xcode generates Swift or Objective-C code for a data model using the data model’s file inspector.
When automatic code generation is enabled for an entity, Xcode creates
either a class or class extension for the entity as specified in the
entity's inspector: the specified class name is used and the sources
are placed in the project’s Derived Data. For both Swift and
Objective-C, these classes are directly usable from the project’s
code. For Objective-C, an additional header file is created for all
generated entities in your model. The header file name conforms to the
naming convention “DataModelName+CoreDataModel.h”.
However, if you selected Category/Extension under the codegen pulldown menu in the data model inspector (because you want to add logic to your model): codegen will wrongly generate both the class definition and properties extension.
The solution is to simply delete the properties extension (ClassName+CoreDataProperties.swift). Your project should now compile.
After following the guidance from oyalhi and Vladimir Shutyuk, (deleting the NSManagedObject files, changing the entity codegen to Manual/None), I had to restart Xcode to allow it to index again before I could re-generate the NSManagedObject files and get a successful compile.
For the sake of completeness..:
I just ran into the same error, but none of the proposed solutions worked. What puzzled me was that even switching from automated code generation to manual for the one (as I thought) problematic entity didn't do anything.
Finally, I figured out that I had several entities with the same name, but they all shared the same classname. The reason for this was that I copy&pasted one entity several times to save me some work, because they also have a few attributes in common.
Turns out XCode renames the duplicates by adding 1, 2,... to the entity name, but leaves the class name as before. And since now entity name and class name are "unrelated", renaming the entity won't change the class name either.
Hope it helps someone - I have also filed a bug report for this.

VS2012 SSRS Cannot See Data Fields

I have a VS2012 SSRS report project with a shared data set. The data set is being created from a SQL Stored Proc. I used to use VS2008, and all of the available data fields would show below the data set, however, in VS2012 I cannot figure out how to get them to show. I've removed the data set, and added it back, I've completely removed the DataSource and added it back, nothing works.
The original report file was built in VS2008, and was converted to a VS2012 project. Not sure if this could be contributing to the problem.
Thank you.
Your screen shot shows the Solution Explorer pane. Data Fields never appeared in this pane, in any version of SSRS.
I suspect what you are looking for is the Report Data Pane, which you should find on the View menu
https://msdn.microsoft.com/en-us/library/cc627528(v=sql.120).aspx

InfoPath cannot run the specified query

For my form I had a database sql table called DeliveryAddress.
I had linked it to a combobox which had some rules to show the fields in textboxes.
That worked great.
Then I got a new updated list so I removed the table on the server and replaced it with the new one. I also called it DeliveryAddresses.
I removed the dataconnection from the form and created a new one.
I changed the ruling of the combobox for the fields.
Then I published the form.
Now I cannot open the published form any more.
I get this error:
The query cannot be run for the following DataObject: DeliveryAddress
InfoPath cannot run the specified query.
[0x80040E37][Microsoft OLE DB Provider for SQL Server] Invalid object name 'dbo.DeliveryAddress'.
When I preview the form, there is no problem.
I have checked all the source files, but the name DeliveryAddress is nowhere to be found.
But still, it's trying to open it somewhere, somehow.
Before I changed the name of the table, I got a simular error, it couldn't find a field that was in the original table but isn't anymore in the new one.
How can I solve this problem?
rg.
Eric
Spent hours trying to find the solution and then just after I posted the question on StackOverflow, I manage to solve it.
I realized that every time you open a new version of a form, it first loads the precious one from an earlier moment and then checks if the version is different.
But because the database changed, the old version couldn't open and that is where the above error occurs.
I went to this (old) webpage and removed all the files from the infopath formcache.
As I have Win7, the path to the formcache is:
c:\users\somename\appdata\local\microsoft\infopath
Appdata is a hidden folder, so you will have to make it visible first!
I hope this will help future users with a similar problem.

Resources