I'm working in an erp project using Visual Studio 2008 Sp1, I've a typed dataset it was containg alot of datatable and alot of table adapter the .Designer.cs file was 8 MB, suddenly when i was trying to openit using visual studio designer the following code comes to me
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="erpDataSet" targetNamespace="http://tempuri.org/erpDataSet1.xsd" xmlns:mstns="http://tempuri.org/erpDataSet1.xsd" xmlns="http://tempuri.org/erpDataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="erpConnectionString" IsAppSettingsProperty="true" Modifier="Assembly" Name="erpConnectionString (Settings)" ParameterPrefix="#" PropertyReference="ApplicationSettings.Sbic.Pro
My XSD file content has gone, :( :( :(
I don't understand why, and how can i recover it.
i mad something but i don't know if it is the reason for that or not, My connectionstring was in the settings "app.config" i removed it and add it to the resources of another project that is refernced by the main project.
what can i do, pleaze help me.
If I understand your problem, you were adding code to the ".Designer.cs". That file is an auto-generated file. Every time you re-save the XSD file, the designer.cs file will be regenerated. You should never add content to a designer.cs file. If you need to add functionality to the dataset, you can extend the dataset by making a "partial" class in a different file using the same namespace that you find in the generated file.
Related
I'm having this issue across all my Flutter projects, thinking it was something wrong I did I opened the Flutter Gallery project but it turns out this problem is present on that project as well. I can't figure out what's wrong because the files for all the projects are there on my File Explorer yet do not display on my IDE. How do I go about correcting this because I do not have an idea at the moment. I've attached images for some visuals
On another post I saw that you need to change this
<?xml version="1.0" encoding="UTF-8"?>
To this
<?xml version="1.0" encoding="UTF-16"?>
But then this happens
And this
Something to note is that changing the UTF from 8 to 16 is inconsistent across projects. For my one project it worked but for this particular one it didn't because not only is it displaying the wrong class in my main.dart it also only shows half of that entire class. The HomePage is unreadable. Some very weird behavior. Because of these inconsistencies I found that this 'solution' isn't the best hence I'm looking for an alternative.
I am using the below code to set the svg file as image view source.
imageView.SetImageDrawable(Resources.System.GetDrawable(Resource.Drawable.Typogy1));
it throws an exception. Please suggest me how to set the svg file to image view.
This example by James Mundy is really good for SVG usage in xamarin android.
But recently in a chat with him, he said and as well as, in my opinion, the best way of using SVG's in an Android application is using Vector Drawables. (Much better than using any libraries)
Vector drawable's are easy to use, maintain and are very lightweight in comparison to images which makes them even better.
An example of how to use it.
Creating SVG vector drawable's is very easy too, using this
Update:
Vector.xml
<?xml version="1.0" encoding="utf-8" ?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="96dp"
android:width="96dp"
android:viewportHeight="48"
android:viewportWidth="48" >
<group>
<path
android:fillColor="#393939"
android:pathData="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z" />
</group>
</vector>
Place this XML in a folder inside your Resources for eg your drawable folder or your layout folder, then use it as follows :
_yourImageView.SetImageResource(Resource.Drawable.Vector);
Goodluck!
Revert in case of any queries.
I create a Xamarin Forms project in VS 2017 and started by adding a TabbedPage with three tabs. I then added the icons to the Android (in Resources/drawable) and iOS (Asset Catalogs/Icons) projects.
When I start the project on Android it works fine, but on iOS I get an exception that the UIImage cannot be loaded because initWithCOntentsOfFile returned nil. Which is actually correct, because that's not the correct method to use to access Assets. But it's the TabbedPage calling the method, so I cannot do anything about it.
The TabbetPage looks pretty basic.
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GreenThumb"
x:Class="GreenThumb.MainPage">
<NavigationPage Title="Today" Icon="current.png">
<x:Arguments>
<local:Current />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Overview" Icon="overview.png">
<x:Arguments>
<local:Overview />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Settings" Icon="settings.png">
<x:Arguments>
<local:Settings />
</x:Arguments>
</NavigationPage>
</TabbedPage>
And the Asset Catalog looks like this:
This problem seems to be pretty old, but I haven't found any solutions aside some very dirty hacks.
Is there a clean solution out there? Or do I just have to add all my images in the Resources folder instead of Asset Catalogs?
I struggled in the past on this issue. It seems that icons for tabbed pages are not working in iOS if placed in the .xcassets.
I moved those .png files inside the Resources folder and that made the magic.
I suppose it's a kind of bug on Xamarin.
The same error was occurring to me, and I was putting the images on the .xcassets on iOS.
When I placed the images on the Resources folder, they appeared normally on my TabbedPage.
In the official Xamarin documentation about images, they say to put the images in the Resources folder.
iOS - Place images in the Resources folder with Build Action:
BundleResource. Retina versions of the image should also be supplied -
two and three times the resolution with a #2x or #3x suffixes on the
filename before the file extension (eg. myimage#2x.png).
I place all my images in the .xcassets folder, they apparently work well, but it seems not to work on every case.
I've created and "deployed" my latest Web Part (Visual Studio grins from ear-to-ear, and tells me, "Deploy succeeded").
But when I go to our Sharepoint site, and my "sandbox" page, and Edit it, I do not see the WebPart. As the Elements file shows, it should be available from the "Financial Affairs Forms" category:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="PostTravelExpenseWebPart" List="113" Url="_catalogs/wp">
<File Path="PostTravelExpenseWebPart\PostTravelExpenseWebPart.webpart" Url="PostTravelExpenseWebPart.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Financial Affairs Forms" />
</File>
</Module>
</Elements>
However, that category is devoid of the "PostTravelExpenseWebPart" I expect (or at least hope) to see there:
What might I be omitting?
UPDATE
I even went so far as to, while in Edit mode on the Web Page, expand the "Upload a Web Part" section below "Categories" after selecting one of the "Add a Web Part" links. I didn't know exactly what to upload (when browsing for a file, the File Dialog doesn't clue you in on what file extension it expects), so I, on a flayer, tried uploading PostTravelExpense.ascx
It accepted it without balking, but I do not see it anywhere (nor do I know why just the *.ascx file would be enough, but again, which file does it expect?) It doesn't allow me to upload the entire project folder.
UPDATE 2
In response to the comment below, note that The project's Assembly Deployment Target" property is set to GlobalAssembyCache
By comparing a working project with this one, I was finally able to get it to deploy without the "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." add-time error msg.
What I had to do was check every place in the working project where the primary namespace was referenced, and make sure that the corresponding namespace in the previously-unworking project was referenced in those same places
This required not only changing some of the files visible in Visual Studio's Solution Explorer treeview, but also two that I only was able to load into the editor by searching for strings they contained, specifically:
The ***.spdata** file, which I loaded up by searching for "SafeControl"
**Assembly.Info**, which I loaded up by searching for "AssemblyTitle"
That sure was a lot of hand-wringing and head-banging and pitiful whin[g]ing for something that one would think would automatically be taken care of by the IDE - when a namespace changes, make all the necessary changes, or at least notify the coder and offer to do so! Or, barring that, at the very least give him a better clue than "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." when the WebPart to be plopped onto the page proves unploppable.
I see that Android Studio creates all XML layout files without the starting
<?xml version="1.0" encoding="utf-8"?>
When did this become unnecessary? I remember that previously it would have generated compile-time error.
If it did not become unnecessary, but the compiler simply ignores it, is it a good practice not to use it?